Spaces:
Runtime error
Runtime error
Update app
Browse files
app.py
CHANGED
@@ -3,15 +3,22 @@ import pandas as pd
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
-
st.sidebar.
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
15 |
|
16 |
st.sidebar.markdown("**Score Filter Options**")
|
17 |
filter_by = st.sidebar.selectbox("Filter By Scores From", ["MRPC", "MRPC-R1"])
|
@@ -21,10 +28,7 @@ display_range_ld = st.sidebar.slider(
|
|
21 |
"Filter by LD Scores", min_value=0.0, max_value=1.0, value=(0.1, 0.4))
|
22 |
display_scores = st.sidebar.checkbox("Display scores", value=False)
|
23 |
|
24 |
-
st.
|
25 |
-
This demo allows you to explore the data inside [MRPC](https://www.microsoft.com/en-us/download/details.aspx?id=52398), showing how we can use Word Position Deviation (WPD) and Lexical Deviation (LD) to find different types of paraphrases. By using what we observe from the data, we can also correct numerous labelling errors inside MRPC, presenting the a revision of MRPC termed as MRPC-R1. This demo accompanies the paper ["Towards Better Characterization of Paraphrases" (ACL 2022)](https://github.com/tlkh/paraphrase-metrics).""")
|
26 |
-
|
27 |
-
st.markdown("**MRPC Paraphrase Data Explorer**")
|
28 |
|
29 |
|
30 |
def load_df(split):
|
@@ -85,8 +89,10 @@ def filter_df(df, display, ptype, filter_by, display_scores):
|
|
85 |
df_sel.sort_values("new_ld", inplace=True)
|
86 |
df_sel.sort_values("new_wpd", inplace=True)
|
87 |
if not display_scores:
|
88 |
-
df_sel.drop(["og_ld", "og_wpd", "new_ld", "new_wpd"],
|
89 |
-
|
|
|
|
|
90 |
df_sel["og/new label"] = label_col
|
91 |
df_sel.drop(["remarks", "og_label", "new_label"], axis=1, inplace=True)
|
92 |
return df_sel
|
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
+
with st.sidebar.expander("Explanation", expanded=False):
|
7 |
+
st.markdown("""This demo allows you to explore the data inside [MRPC](https://www.microsoft.com/en-us/download/details.aspx?id=52398),
|
8 |
+
showing how we can use Word Position Deviation (WPD) and Lexical Deviation (LD) to find different types of paraphrases.
|
9 |
+
By using what we observe from the data, we can also correct numerous labelling errors inside MRPC, presenting the a revision of MRPC termed as MRPC-R1.
|
10 |
+
You can see the rejected and corrected paraphrases by changing the **Display Types** option below.
|
11 |
+
This demo accompanies the paper ["Towards Better Characterization of Paraphrases" (ACL 2022)](https://github.com/tlkh/paraphrase-metrics).""")
|
12 |
|
13 |
+
with st.sidebar.expander("Dataset Options", expanded=False):
|
14 |
+
split = st.selectbox("Dataset Split", ["train", "test"])
|
15 |
+
display = st.selectbox("Source", ["All", "Only MRPC", "Only MRPC-R1"])
|
16 |
+
|
17 |
+
ptype = st.sidebar.radio("Display Types", ["All",
|
18 |
+
"Only Paraphrases (MRPC-R1)",
|
19 |
+
"Only Paraphrases (MRPC)",
|
20 |
+
"Rejected Paraphrases from MRPC",
|
21 |
+
"Corrected Paraphrases from MRPC"])
|
22 |
|
23 |
st.sidebar.markdown("**Score Filter Options**")
|
24 |
filter_by = st.sidebar.selectbox("Filter By Scores From", ["MRPC", "MRPC-R1"])
|
|
|
28 |
"Filter by LD Scores", min_value=0.0, max_value=1.0, value=(0.1, 0.4))
|
29 |
display_scores = st.sidebar.checkbox("Display scores", value=False)
|
30 |
|
31 |
+
st.markdown("### MRPC Paraphrase Data Explorer")
|
|
|
|
|
|
|
32 |
|
33 |
|
34 |
def load_df(split):
|
|
|
89 |
df_sel.sort_values("new_ld", inplace=True)
|
90 |
df_sel.sort_values("new_wpd", inplace=True)
|
91 |
if not display_scores:
|
92 |
+
df_sel.drop(["og_ld", "og_wpd", "new_ld", "new_wpd"],
|
93 |
+
axis=1, inplace=True)
|
94 |
+
label_col = df_sel["og_label"].astype(
|
95 |
+
str)+"->"+df_sel["new_label"].astype(str)
|
96 |
df_sel["og/new label"] = label_col
|
97 |
df_sel.drop(["remarks", "og_label", "new_label"], axis=1, inplace=True)
|
98 |
return df_sel
|