Spaces:
Runtime error
Runtime error
Remove paraphrase and swap fine-tuning task order
Browse files
app.py
CHANGED
|
@@ -131,27 +131,6 @@ if st.button("Fill the mask"):
|
|
| 131 |
st.write("_English_ _translation:_", translate(result_sequence, "en", "es"))
|
| 132 |
st.write(result)
|
| 133 |
|
| 134 |
-
st.markdown(
|
| 135 |
-
"""
|
| 136 |
-
### Fine-tuning to XNLI for paraphrase identification
|
| 137 |
-
Here you can play with the RoBERTa Base Gaussian Seq Len 512 model fine-tuned to XNLI.
|
| 138 |
-
"""
|
| 139 |
-
)
|
| 140 |
-
|
| 141 |
-
pawsx_model_url = "bertin-project/bertin-base-xnli-es"
|
| 142 |
-
paraphrase_prompt = st.selectbox("Paraphrase Prompt", ["Random", "Custom"])
|
| 143 |
-
if paraphrase_prompt == "Custom":
|
| 144 |
-
paraphrase_prompt_box = "Enter two sentences separated by </s> here..."
|
| 145 |
-
else:
|
| 146 |
-
paraphrase_prompt_box = random.choice(PAWS_X_PROMPT_LIST)
|
| 147 |
-
text = st.text_area("Enter text", paraphrase_prompt_box)
|
| 148 |
-
if st.button("Clasify paraphrasing"):
|
| 149 |
-
with st.spinner(text="Clasifying paraphrasing..."):
|
| 150 |
-
st.subheader("Classification result")
|
| 151 |
-
paraphrase_score = load_model_pair_classification(text, pawsx_model_url)
|
| 152 |
-
st.write("_English_ _translation:_", translate(text, "en", "es"))
|
| 153 |
-
st.write(paraphrase_score)
|
| 154 |
-
|
| 155 |
|
| 156 |
def make_color_palette(labels):
|
| 157 |
color_palette = sns.color_palette(n_colors=len(labels))
|
|
@@ -266,6 +245,27 @@ if st.button("Recognize named entities"):
|
|
| 266 |
else:
|
| 267 |
st.write("No entities found")
|
| 268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
st.markdown(
|
| 270 |
"""
|
| 271 |
### Team members
|
|
|
|
| 131 |
st.write("_English_ _translation:_", translate(result_sequence, "en", "es"))
|
| 132 |
st.write(result)
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
def make_color_palette(labels):
|
| 136 |
color_palette = sns.color_palette(n_colors=len(labels))
|
|
|
|
| 245 |
else:
|
| 246 |
st.write("No entities found")
|
| 247 |
|
| 248 |
+
st.markdown(
|
| 249 |
+
"""
|
| 250 |
+
### Fine-tuning to XNLI
|
| 251 |
+
Here you can play with the RoBERTa Base Gaussian Seq Len 512 model fine-tuned to XNLI.
|
| 252 |
+
"""
|
| 253 |
+
)
|
| 254 |
+
|
| 255 |
+
pawsx_model_url = "bertin-project/bertin-base-xnli-es"
|
| 256 |
+
paraphrase_prompt = st.selectbox("Paraphrase Prompt", ["Random", "Custom"])
|
| 257 |
+
if paraphrase_prompt == "Custom":
|
| 258 |
+
paraphrase_prompt_box = "Enter two sentences separated by </s> here..."
|
| 259 |
+
else:
|
| 260 |
+
paraphrase_prompt_box = random.choice(PAWS_X_PROMPT_LIST)
|
| 261 |
+
text = st.text_area("Enter text", paraphrase_prompt_box)
|
| 262 |
+
if st.button("Clasify paraphrasing"):
|
| 263 |
+
with st.spinner(text="Clasifying paraphrasing..."):
|
| 264 |
+
st.subheader("Classification result")
|
| 265 |
+
paraphrase_score = load_model_pair_classification(text, pawsx_model_url)
|
| 266 |
+
st.write("_English_ _translation:_", translate(text, "en", "es"))
|
| 267 |
+
st.write(paraphrase_score)
|
| 268 |
+
|
| 269 |
st.markdown(
|
| 270 |
"""
|
| 271 |
### Team members
|