Revert the code
Browse files
app.py
CHANGED
|
@@ -1,10 +1,7 @@
|
|
| 1 |
from transformers import AutoTokenizer
|
| 2 |
from transformers import AutoModelForSequenceClassification
|
| 3 |
-
import spacy
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
-
spacy.cli.download("en_core_web_lg")
|
| 7 |
-
nlp = spacy.load("en_core_web_lg")
|
| 8 |
model_name = "biodatlab/score-claim-identification"
|
| 9 |
tokenizer_name = "allenai/scibert_scivocab_uncased"
|
| 10 |
|
|
@@ -19,7 +16,7 @@ def inference(abstract: str):
|
|
| 19 |
if abstract.strip() == "":
|
| 20 |
return "Please provide an abstract as an input."
|
| 21 |
claims = []
|
| 22 |
-
sents =
|
| 23 |
inputs = tokenizer(
|
| 24 |
sents,
|
| 25 |
return_tensors="pt",
|
|
|
|
| 1 |
from transformers import AutoTokenizer
|
| 2 |
from transformers import AutoModelForSequenceClassification
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
|
|
|
|
|
|
| 5 |
model_name = "biodatlab/score-claim-identification"
|
| 6 |
tokenizer_name = "allenai/scibert_scivocab_uncased"
|
| 7 |
|
|
|
|
| 16 |
if abstract.strip() == "":
|
| 17 |
return "Please provide an abstract as an input."
|
| 18 |
claims = []
|
| 19 |
+
sents = abstract.split(". ") # abstract to sentences
|
| 20 |
inputs = tokenizer(
|
| 21 |
sents,
|
| 22 |
return_tensors="pt",
|