Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ def query(payload):
|
|
25 |
API_URL_evidence = "https://api-inference.huggingface.co/models/google/flan-t5-xxl"
|
26 |
headers_evidence = {"Authorization": HF_SPACES_API_KEY}
|
27 |
|
28 |
-
|
29 |
def query_evidence(payload):
|
30 |
response = requests.post(API_URL_evidence, headers=headers_evidence, json=payload)
|
31 |
return response.json()
|
@@ -145,7 +145,7 @@ import allennlp_models.tagging
|
|
145 |
predictor = Predictor.from_path("structured-prediction-srl-bert.tar.gz")
|
146 |
|
147 |
#---------------------------------------------------------------
|
148 |
-
list_of_pronouns = ["I", "you", "he", "she", "it", "we", "they", "me", "him", "her", "us", "them",
|
149 |
"mine", "yours", "his", "hers", "its", "ours", "theirs",
|
150 |
"this", "that", "these", "those",
|
151 |
"myself", "yourself", "himself", "herself", "itself", "ourselves", "yourselves", "themselves",
|
@@ -154,7 +154,7 @@ list_of_pronouns = ["I", "you", "he", "she", "it", "we", "they", "me", "him", "h
|
|
154 |
"everybody", "everyone", "everything", "few", "many", "neither", "nobody", "none", "nothing",
|
155 |
"one", "other", "several", "some", "somebody", "someone", "something"]
|
156 |
#---------------------------------------------------------------
|
157 |
-
|
158 |
def srl(text):
|
159 |
import re
|
160 |
def remove_special_chars(text):
|
|
|
25 |
API_URL_evidence = "https://api-inference.huggingface.co/models/google/flan-t5-xxl"
|
26 |
headers_evidence = {"Authorization": HF_SPACES_API_KEY}
|
27 |
|
28 |
+
@st.cache(suppress_st_warning=True)
|
29 |
def query_evidence(payload):
|
30 |
response = requests.post(API_URL_evidence, headers=headers_evidence, json=payload)
|
31 |
return response.json()
|
|
|
145 |
predictor = Predictor.from_path("structured-prediction-srl-bert.tar.gz")
|
146 |
|
147 |
#---------------------------------------------------------------
|
148 |
+
list_of_pronouns = ["I","i", "you", "he", "she", "it", "we", "they", "me", "him", "her", "us", "them",
|
149 |
"mine", "yours", "his", "hers", "its", "ours", "theirs",
|
150 |
"this", "that", "these", "those",
|
151 |
"myself", "yourself", "himself", "herself", "itself", "ourselves", "yourselves", "themselves",
|
|
|
154 |
"everybody", "everyone", "everything", "few", "many", "neither", "nobody", "none", "nothing",
|
155 |
"one", "other", "several", "some", "somebody", "someone", "something"]
|
156 |
#---------------------------------------------------------------
|
157 |
+
@st.cache
|
158 |
def srl(text):
|
159 |
import re
|
160 |
def remove_special_chars(text):
|