Spaces:
Runtime error
Runtime error
File size: 680 Bytes
2ad1bab e25282d 292db1c 2ad1bab 292db1c 0ca76da 292db1c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import gradio as gr
from AinaTheme import AinaGradioTheme
from transformers import pipeline
# gr.load("projecte-aina/multiner_ceil",src="models",aggregation_strategy="first", **AinaGradioTheme().get_kwargs()).launch()
import gradio as gr
ner_pipeline = pipeline("token-classification", model="projecte-aina/multiner_ceil")
# examples = [
# "Does Chicago have any stores and does Joe live here?",
# ]
def ner(text):
output = ner_pipeline(text)
return {"text": text, "entities": output}
demo = gr.Interface(ner,
gr.Textbox(placeholder="Enter sentence here..."),
gr.HighlightedText(), **AinaGradioTheme().get_kwargs())
demo.launch() |