Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
model_name = "
|
| 5 |
|
| 6 |
def ner_analysis(text):
|
| 7 |
ner_pipeline = pipeline('ner', model=model_name, use_auth_token=None, aggregation_strategy="max")
|
|
@@ -11,7 +11,7 @@ def ner_analysis(text):
|
|
| 11 |
|
| 12 |
with gr.Blocks() as demo:
|
| 13 |
gr.Markdown("# Named Entity Recognition")
|
| 14 |
-
gr.Markdown("Powered by
|
| 15 |
text_input = gr.Textbox(label="Text", placeholder="Enter text to analyze entities...", lines=3)
|
| 16 |
output = gr.Textbox(label="Entities", lines=5)
|
| 17 |
btn = gr.Button("Analyze")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
model_name = "dslim/bert-base-NER"
|
| 5 |
|
| 6 |
def ner_analysis(text):
|
| 7 |
ner_pipeline = pipeline('ner', model=model_name, use_auth_token=None, aggregation_strategy="max")
|
|
|
|
| 11 |
|
| 12 |
with gr.Blocks() as demo:
|
| 13 |
gr.Markdown("# Named Entity Recognition")
|
| 14 |
+
gr.Markdown("Powered by dslim/bert-base-NER")
|
| 15 |
text_input = gr.Textbox(label="Text", placeholder="Enter text to analyze entities...", lines=3)
|
| 16 |
output = gr.Textbox(label="Entities", lines=5)
|
| 17 |
btn = gr.Button("Analyze")
|