Spaces:
Sleeping
Sleeping
Commit ·
e7ca22f
1
Parent(s): e716049
experiment
Browse files
__pycache__/absa_evaluator.cpython-39.pyc
ADDED
|
Binary file (4.26 kB). View file
|
|
|
__pycache__/preprocessing.cpython-310.pyc
ADDED
|
Binary file (3.69 kB). View file
|
|
|
__pycache__/preprocessing.cpython-39.pyc
ADDED
|
Binary file (3.68 kB). View file
|
|
|
app.py
CHANGED
|
@@ -1,6 +1,21 @@
|
|
| 1 |
-
import
|
| 2 |
-
from
|
| 3 |
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from absa_evaluator import AbsaEvaluatorTest
|
| 3 |
|
| 4 |
+
def evaluate_texts(predictions, references):
|
| 5 |
+
evaluator = AbsaEvaluatorTest()
|
| 6 |
+
return evaluator.compute(predictions, references)
|
| 7 |
|
| 8 |
+
def main():
|
| 9 |
+
iface = gr.Interface(
|
| 10 |
+
fn=evaluate_texts, # The evaluation function you want to use
|
| 11 |
+
inputs=[
|
| 12 |
+
gr.Textbox(lines=2, placeholder="Enter Predictions Here..."),
|
| 13 |
+
gr.Textbox(lines=2, placeholder="Enter References Here...")
|
| 14 |
+
],
|
| 15 |
+
outputs=gr.Textbox()
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
iface.launch()
|
| 19 |
+
|
| 20 |
+
if __name__ == "__main__":
|
| 21 |
+
main()
|
requirements.txt
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
git+https://github.com/huggingface/evaluate@a4bdc10c48a450b978d91389a48dbb5297835c7d
|
| 2 |
-
scikit-learn
|
|
|
|
|
|
| 1 |
git+https://github.com/huggingface/evaluate@a4bdc10c48a450b978d91389a48dbb5297835c7d
|
| 2 |
+
scikit-learn
|
| 3 |
+
gradio
|