Spaces:
Runtime error
Runtime error
Commit ·
51d268c
1
Parent(s): a4f1003
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,10 +13,10 @@ import os
|
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
-
nlp = pipeline("ner", model="
|
| 17 |
|
| 18 |
examples = [
|
| 19 |
-
["
|
| 20 |
]
|
| 21 |
|
| 22 |
def create_record(input_text, feedback):
|
|
@@ -44,7 +44,7 @@ def create_record(input_text, feedback):
|
|
| 44 |
text=input_text,
|
| 45 |
tokens=words,
|
| 46 |
prediction=prediction,
|
| 47 |
-
prediction_agent="
|
| 48 |
status=status,
|
| 49 |
metadata={"feedback": feedback}
|
| 50 |
)
|
|
@@ -71,15 +71,15 @@ class ArgillaLogger(FlaggingCallback):
|
|
| 71 |
|
| 72 |
|
| 73 |
gr.Interface.load(
|
| 74 |
-
"
|
| 75 |
examples=examples,
|
| 76 |
-
title = "NER
|
| 77 |
-
description = "
|
| 78 |
allow_flagging="manual",
|
| 79 |
flagging_callback=ArgillaLogger(
|
| 80 |
-
api_url="https://
|
| 81 |
-
api_key=os.getenv("TEAM_API_KEY"),
|
| 82 |
dataset_name="ner-flags"
|
| 83 |
),
|
| 84 |
-
flagging_options=["
|
| 85 |
).launch()
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
+
nlp = pipeline("ner", model="mrm8488/bert-spanish-cased-finetuned-ner")
|
| 17 |
|
| 18 |
examples = [
|
| 19 |
+
["Mi nombre es Juan y vivo en Barcelona"]
|
| 20 |
]
|
| 21 |
|
| 22 |
def create_record(input_text, feedback):
|
|
|
|
| 44 |
text=input_text,
|
| 45 |
tokens=words,
|
| 46 |
prediction=prediction,
|
| 47 |
+
prediction_agent="gradio_crowd",
|
| 48 |
status=status,
|
| 49 |
metadata={"feedback": feedback}
|
| 50 |
)
|
|
|
|
| 71 |
|
| 72 |
|
| 73 |
gr.Interface.load(
|
| 74 |
+
"mrm8488/bert-spanish-cased-finetuned-ner",
|
| 75 |
examples=examples,
|
| 76 |
+
title = "NER en Español, crowdsource con Argilla",
|
| 77 |
+
description = "Ayudanos a mejorar este model introduciendo un ejemplo clasificandolo como correcto, incorrecto o ambiguo",
|
| 78 |
allow_flagging="manual",
|
| 79 |
flagging_callback=ArgillaLogger(
|
| 80 |
+
api_url="https://dvilasuero-taller-somosnlp.hf.space",
|
| 81 |
+
api_key="os.getenv("TEAM_API_KEY")",
|
| 82 |
dataset_name="ner-flags"
|
| 83 |
),
|
| 84 |
+
flagging_options=["Correcto", "Incorrecto", "Ambiguo"]
|
| 85 |
).launch()
|