Upload 3 files
Browse files- README.md +6 -6
- app.py +3 -1
- requirements.txt +1 -2
README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
-
sdk_version:
|
8 |
app_file: app.py
|
9 |
-
pinned:
|
10 |
license: mit
|
11 |
---
|
12 |
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces
|
|
|
1 |
---
|
2 |
+
title: PyABSA
|
3 |
+
emoji: π
|
4 |
+
colorFrom: pink
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.36.1
|
8 |
app_file: app.py
|
9 |
+
pinned: true
|
10 |
license: mit
|
11 |
---
|
12 |
|
13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -162,7 +162,7 @@ def perform_aste_inference(text, dataset):
|
|
162 |
result = triplet_extractor.predict(text)
|
163 |
|
164 |
pred_triplets = pd.DataFrame(result["Triplets"])
|
165 |
-
true_triplets = pd.DataFrame(result["True Triplets"])
|
166 |
return pred_triplets, true_triplets, "{}".format(text.split("####")[0])
|
167 |
|
168 |
|
@@ -180,6 +180,8 @@ def perform_acos_inference(text, dataset):
|
|
180 |
|
181 |
|
182 |
def run_demo(text, dataset, task):
|
|
|
|
|
183 |
try:
|
184 |
data = {
|
185 |
"text": text,
|
|
|
162 |
result = triplet_extractor.predict(text)
|
163 |
|
164 |
pred_triplets = pd.DataFrame(result["Triplets"])
|
165 |
+
true_triplets = pd.DataFrame(result["True Triplets"]) if result["True Triplets"] else None
|
166 |
return pred_triplets, true_triplets, "{}".format(text.split("####")[0])
|
167 |
|
168 |
|
|
|
180 |
|
181 |
|
182 |
def run_demo(text, dataset, task):
|
183 |
+
if len(text) > 3000:
|
184 |
+
raise RuntimeError('Text is too long!')
|
185 |
try:
|
186 |
data = {
|
187 |
"text": text,
|
requirements.txt
CHANGED
@@ -1,3 +1,2 @@
|
|
1 |
pyabsa>=2.1.12
|
2 |
-
transformers<=4.29.0
|
3 |
-
setuptools<65
|
|
|
1 |
pyabsa>=2.1.12
|
2 |
+
transformers<=4.29.0
|
|