Spaces:
Sleeping
Sleeping
Minor update
Browse files
app.py
CHANGED
|
@@ -31,12 +31,13 @@ def ner(input):
|
|
| 31 |
merged_tokens = merge_tokens(output)
|
| 32 |
return {"text": input, "entities": merged_tokens}
|
| 33 |
|
|
|
|
| 34 |
demo = gr.Interface(fn=ner,
|
| 35 |
inputs=[gr.Textbox(label="Text to find entities", lines=2)],
|
| 36 |
outputs=[gr.HighlightedText(label="Text with entities")],
|
| 37 |
title="NER with dslim/bert-base-NER",
|
| 38 |
description="Find entities using the `dslim/bert-base-NER` model under the hood!",
|
| 39 |
-
|
| 40 |
examples=[
|
| 41 |
"My name is Andrew, I'm building DeeplearningAI and I live in California",
|
| 42 |
"My name is Poli, I live in Vienna and work at HuggingFace"
|
|
@@ -45,5 +46,5 @@ demo = gr.Interface(fn=ner,
|
|
| 45 |
|
| 46 |
demo.launch(
|
| 47 |
share=True,
|
| 48 |
-
#server_port=int(os.environ
|
| 49 |
)
|
|
|
|
| 31 |
merged_tokens = merge_tokens(output)
|
| 32 |
return {"text": input, "entities": merged_tokens}
|
| 33 |
|
| 34 |
+
# Create Gradio interface
|
| 35 |
demo = gr.Interface(fn=ner,
|
| 36 |
inputs=[gr.Textbox(label="Text to find entities", lines=2)],
|
| 37 |
outputs=[gr.HighlightedText(label="Text with entities")],
|
| 38 |
title="NER with dslim/bert-base-NER",
|
| 39 |
description="Find entities using the `dslim/bert-base-NER` model under the hood!",
|
| 40 |
+
flagging_mode="never", # Updated from allow_flagging
|
| 41 |
examples=[
|
| 42 |
"My name is Andrew, I'm building DeeplearningAI and I live in California",
|
| 43 |
"My name is Poli, I live in Vienna and work at HuggingFace"
|
|
|
|
| 46 |
|
| 47 |
demo.launch(
|
| 48 |
share=True,
|
| 49 |
+
# server_port=int(os.environ.get('PORT2', 7860)) # Uncomment if needed
|
| 50 |
)
|