Commit
•
c002b34
1
Parent(s):
8146394
use model from https://huggingface.co/ArneBinder/sam-pointer-bart-base-v0.3/discussions/1
Browse files- app.py +7 -9
- requirements.txt +3 -3
app.py
CHANGED
@@ -55,17 +55,18 @@ def close_accordion():
|
|
55 |
if __name__ == "__main__":
|
56 |
|
57 |
model_name_or_path = "ArneBinder/sam-pointer-bart-base-v0.3"
|
|
|
58 |
# local path
|
59 |
# model_name_or_path = "models/dataset-sciarg/task-ner_re/v0.3/2024-03-01_18-25-32"
|
60 |
|
61 |
example_text = "Scholarly Argumentation Mining (SAM) has recently gained attention due to its potential to help scholars with the rapid growth of published scientific literature. It comprises two subtasks: argumentative discourse unit recognition (ADUR) and argumentative relation extraction (ARE), both of which are challenging since they require e.g. the integration of domain knowledge, the detection of implicit statements, and the disambiguation of argument structure. While previous work focused on dataset construction and baseline methods for specific document sections, such as abstract or results, full-text scholarly argumentation mining has seen little progress. In this work, we introduce a sequential pipeline model combining ADUR and ARE for full-text SAM, and provide a first analysis of the performance of pretrained language models (PLMs) on both subtasks. We establish a new SotA for ADUR on the Sci-Arg corpus, outperforming the previous best reported result by a large margin (+7% F1). We also present the first results for ARE, and thus for the full AM pipeline, on this benchmark dataset. Our detailed error analysis reveals that non-contiguous ADUs as well as the interpretation of discourse connectors pose major challenges and that data annotation needs to be more consistent."
|
62 |
|
63 |
-
pipeline = AutoPipeline.from_pretrained(
|
64 |
-
re_pipeline = AutoPipeline.from_pretrained(
|
65 |
model_name_or_path,
|
66 |
device=-1,
|
67 |
num_workers=0,
|
68 |
-
|
|
|
69 |
)
|
70 |
|
71 |
default_render_kwargs = {
|
@@ -85,13 +86,10 @@ if __name__ == "__main__":
|
|
85 |
"supports": "#9f9",
|
86 |
# red
|
87 |
"contradicts": "#f99",
|
88 |
-
#
|
89 |
-
"parts_of_same":
|
90 |
-
},
|
91 |
-
"head": {
|
92 |
-
# show in same color as "selected"
|
93 |
-
"parts_of_same": "#ffa",
|
94 |
},
|
|
|
95 |
"other": None,
|
96 |
},
|
97 |
}
|
|
|
55 |
if __name__ == "__main__":
|
56 |
|
57 |
model_name_or_path = "ArneBinder/sam-pointer-bart-base-v0.3"
|
58 |
+
revision = "85d9e20208e0dcbac80753fde7f5b3a4f61b5772"
|
59 |
# local path
|
60 |
# model_name_or_path = "models/dataset-sciarg/task-ner_re/v0.3/2024-03-01_18-25-32"
|
61 |
|
62 |
example_text = "Scholarly Argumentation Mining (SAM) has recently gained attention due to its potential to help scholars with the rapid growth of published scientific literature. It comprises two subtasks: argumentative discourse unit recognition (ADUR) and argumentative relation extraction (ARE), both of which are challenging since they require e.g. the integration of domain knowledge, the detection of implicit statements, and the disambiguation of argument structure. While previous work focused on dataset construction and baseline methods for specific document sections, such as abstract or results, full-text scholarly argumentation mining has seen little progress. In this work, we introduce a sequential pipeline model combining ADUR and ARE for full-text SAM, and provide a first analysis of the performance of pretrained language models (PLMs) on both subtasks. We establish a new SotA for ADUR on the Sci-Arg corpus, outperforming the previous best reported result by a large margin (+7% F1). We also present the first results for ARE, and thus for the full AM pipeline, on this benchmark dataset. Our detailed error analysis reveals that non-contiguous ADUs as well as the interpretation of discourse connectors pose major challenges and that data annotation needs to be more consistent."
|
63 |
|
64 |
+
pipeline = AutoPipeline.from_pretrained(
|
|
|
65 |
model_name_or_path,
|
66 |
device=-1,
|
67 |
num_workers=0,
|
68 |
+
taskmodule_kwargs=dict(revision=revision),
|
69 |
+
model_kwargs=dict(revision=revision),
|
70 |
)
|
71 |
|
72 |
default_render_kwargs = {
|
|
|
86 |
"supports": "#9f9",
|
87 |
# red
|
88 |
"contradicts": "#f99",
|
89 |
+
# do not highlight
|
90 |
+
"parts_of_same": None,
|
|
|
|
|
|
|
|
|
91 |
},
|
92 |
+
"head": None, # "#faf",
|
93 |
"other": None,
|
94 |
},
|
95 |
}
|
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
transformers==4.
|
2 |
-
gradio
|
3 |
prettytable==3.10.0
|
4 |
-
pie-modules>=0.
|
5 |
beautifulsoup4==4.12.3
|
|
|
1 |
+
transformers==4.39.3
|
2 |
+
gradio==4.31.4
|
3 |
prettytable==3.10.0
|
4 |
+
pie-modules>=0.11.0,<0.12.0
|
5 |
beautifulsoup4==4.12.3
|