Spaces:
Runtime error
Runtime error
Update app
Browse files
app.py
CHANGED
@@ -3,16 +3,20 @@ import pandas as pd
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
-
with st.sidebar.expander("Explanation", expanded=False):
|
7 |
-
st.markdown("""
|
8 |
-
|
9 |
-
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
split = st.selectbox("Dataset Split", ["train", "test"])
|
15 |
-
display = st.selectbox("
|
16 |
|
17 |
ptype = st.sidebar.radio("Display Types", ["All",
|
18 |
"Only Paraphrases (MRPC-R1)",
|
@@ -39,9 +43,9 @@ def load_df(split):
|
|
39 |
|
40 |
def filter_df(df, display, ptype, filter_by, display_scores):
|
41 |
# filter data
|
42 |
-
if display == "MRPC":
|
43 |
df = df.drop(["new_s1", "new_s2"], axis=1)
|
44 |
-
elif display == "MRPC-R1":
|
45 |
df = df.drop(["og_s1", "og_s2"], axis=1)
|
46 |
# filter paraphrase type
|
47 |
if ptype == "Only Paraphrases (MRPC)":
|
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
+
with st.sidebar.expander("📍 Explanation", expanded=False):
|
7 |
+
st.markdown("""
|
8 |
+
This demo allows you to explore the data inside the [MRPC](https://www.microsoft.com/en-us/download/details.aspx?id=52398) dataset.
|
9 |
+
It illustrates how **Word Position Deviation (WPD)** and **Lexical Deviation (LD)** can be used to find different types of [paraphrase pairs](https://direct.mit.edu/coli/article/39/3/463/1434/What-Is-a-Paraphrase) inside MRPC.
|
|
|
|
|
10 |
|
11 |
+
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**.
|
12 |
+
By changing the **Display Types** option below, you can filter the displayed pairs to show pairs that were rejected (label changed from paraphrase to non-paraphrase) or corrected (inconsistencies corrected).
|
13 |
+
|
14 |
+
This demo accompanies the paper ["Towards Better Characterization of Paraphrases" (ACL 2022)](https://github.com/tlkh/paraphrase-metrics), which describes in detail the methodologies used.""")
|
15 |
+
|
16 |
+
with st.sidebar.expander("⚙️ Dataset Options", expanded=False):
|
17 |
+
st.markdown("This allows you to switch between the MRPC train and test sets, as well as choose to display only the original paraphrase pairs (MRPC) and/or the corrected pairs (MRPC-R1).")
|
18 |
split = st.selectbox("Dataset Split", ["train", "test"])
|
19 |
+
display = st.selectbox("Display only pairs from", ["All", "Only MRPC", "Only MRPC-R1"])
|
20 |
|
21 |
ptype = st.sidebar.radio("Display Types", ["All",
|
22 |
"Only Paraphrases (MRPC-R1)",
|
|
|
43 |
|
44 |
def filter_df(df, display, ptype, filter_by, display_scores):
|
45 |
# filter data
|
46 |
+
if display == "Only MRPC":
|
47 |
df = df.drop(["new_s1", "new_s2"], axis=1)
|
48 |
+
elif display == "Only MRPC-R1":
|
49 |
df = df.drop(["og_s1", "og_s2"], axis=1)
|
50 |
# filter paraphrase type
|
51 |
if ptype == "Only Paraphrases (MRPC)":
|