Spaces:
Runtime error
Runtime error
Commit
·
a6177b6
1
Parent(s):
7436937
Update app.py
Browse files
app.py
CHANGED
@@ -81,35 +81,11 @@ def theme_classification(text, text_classifier):
|
|
81 |
|
82 |
sid_obj = SentimentIntensityAnalyzer()
|
83 |
classifier = pipeline("zero-shot-classification", model="joeddav/xlm-roberta-large-xnli")
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
is_title = []
|
90 |
-
texts = []
|
91 |
-
themes = []
|
92 |
-
trans_text = []
|
93 |
-
url = []
|
94 |
-
|
95 |
-
st.dataframe(df)
|
96 |
-
|
97 |
-
for i in range(len(dataset)):
|
98 |
-
dates.append(dataset["train"][i]["date"])
|
99 |
-
is_title.append(dataset["train"][i]["is_title"])
|
100 |
-
texts.append(dataset["train"][i]["texts"])
|
101 |
-
themes.append(dataset["train"][i]["theme"])
|
102 |
-
trans_text.append(dataset["train"][i]["translated"])
|
103 |
-
url.append(dataset["train"][i]["url"])
|
104 |
-
|
105 |
-
new_df["date"] = dates
|
106 |
-
new_df["text"] = texts
|
107 |
-
new_df["theme"] = themes
|
108 |
-
new_df["translated"] = trans_text
|
109 |
-
new_df["is_title"] = is_title
|
110 |
-
new_df["url"] = url
|
111 |
-
|
112 |
-
df = new_df[:]
|
113 |
|
114 |
header = st.container()
|
115 |
model = st.container()
|
|
|
81 |
|
82 |
sid_obj = SentimentIntensityAnalyzer()
|
83 |
classifier = pipeline("zero-shot-classification", model="joeddav/xlm-roberta-large-xnli")
|
84 |
+
|
85 |
+
sheet_id = "1IGFSKnnmQndKVmGOWMCbsvJJMU_2jvnm"
|
86 |
+
sheet_name = "Sheet1"
|
87 |
+
url = f"https://docs.google.com/spreadsheets/d/{sheet_id}/gviz/tq?tqx=out:csv&sheet={sheet_name}"
|
88 |
+
df = pd.read_csv(url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
header = st.container()
|
91 |
model = st.container()
|