Hi there!
I am using blocks to create a custom annotation interface with multiple different blocks. One block I am struggling with is the html block. I want to load in the dependency svg created by displacy.render which is too large for the prodigy.content div so I would like to add something along the lines of overflow:auto to the prodigy.content element.
I tried to do that in the prodigy.json file like this:
{ "global-css": ".prodigy-content{ overflow: auto; background-color:green }" }
(Background just to check if anything is happening at all which is not the case)
and in my recipe.py file (without anything in the prodigy.json file) which looks like this:
import prodigy
from prodigy.components.preprocess import add_tokens
import requests
import spacy
from prodigy.components.loaders import Audio
import re
from spacy import displacy
nlp = spacy.load("de_core_news_sm")
doc = nlp("Das ist ein Test. Das ist, um den Test länger zu machen. Das Html muss scrollbar sein. Und nicht zu breit.")
pos_tag = displacy.render(doc)
pos_tag = re.sub("max-width: none", "max-width: 100%; max-height: 80%; overflow::auto" ,pos_tag)
@prodigy.recipe("custom_recipe")
def custom_recipe(dataset, audio_path):
stream = Audio(audio_path)
blocks = [
{"view_id": "html", "html_template": pos_tag},
{"view_id":"audio"},
{"view_id": "ner_manual"},
]
return{
"dataset": dataset,
"stream": stream,
"view_id": "blocks",
"config": {
"labels": ["LABEL1", "LABEL2"],
"blocks":blocks, "config": { "ui-lang":"de", "global-css": ".prodigy-content{ overflow: auto; background-color:green }" }
In both cases, nothing at all changes but unfortunately I don't get any error either, so I am quite stuck right now. Do you know what might be the reason?
Cheers!