hsuvaskakoty commited on
Commit
e5eb7fe
·
verified ·
1 Parent(s): 2e68d8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -83
app.py CHANGED
@@ -17,7 +17,18 @@ platform_dict = ["wikipedia", "wikidata_entity", "wikidata_property", "wikinews"
17
  lang_dict = ["en", "es", "gr"]
18
 
19
  title = 'Wide-Analysis: A Wikipedia Deletion Discussion Analysis Suite'
20
- desc = """ Wide-Analysis is a suite of tools for analyzing deletion discussions across various Wikimedia platforms in multiple languages... """
 
 
 
 
 
 
 
 
 
 
 
21
 
22
 
23
  def process_url(url, task_name, lang, platform, date):
@@ -101,85 +112,3 @@ demo = gr.Interface(fn=process_url,
101
  title=title,
102
  description=desc)
103
  demo.launch(share=True)
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
- # import data_prep
129
- # import model_predict
130
- # import gradio as gr
131
-
132
- # # model_dict = {
133
- # # "BERT-Base": "research-dump/bert-base-uncased_deletion_multiclass_complete_Final",
134
- # # "BERT-Large": "research-dump/bert-large-uncased_deletion_multiclass_complete_final",
135
- # # "RoBERTa-Base": "research-dump/roberta-base_deletion_multiclass_complete_final",
136
- # # "RoBERTa-Large": "research-dump/roberta-large_deletion_multiclass_complete_final"
137
- # # }
138
-
139
- # model_dict = {
140
- # "Outcome Prediction": "outcome",
141
- # "Stance Detection": "stance",
142
- # "Policy Prediction": "policy",
143
- # "Sentiment Analysis": "sentiment",
144
- # "Offensive Language Detection": "offensive"
145
- # }
146
-
147
- # def process_url(url, model_name):
148
- # model_name = model_dict[model_name]
149
- # processed_text = data_prep.process_data(url)
150
- # final_scores = model_predict.predict_text(processed_text, model_name)
151
- # if model_name == 'outcome':
152
- # highest_prob_item = max(final_scores, key=lambda x: x['score'])
153
- # highest_prob_label = highest_prob_item['outcome']
154
- # highest_prob = highest_prob_item['score']
155
- # progress_bars = {item['outcome']: item['score'] for item in final_scores}
156
-
157
- # return processed_text, highest_prob_label, highest_prob, progress_bars
158
-
159
- # else:
160
- # return processed_text, "", "", final_scores
161
-
162
- # title = 'Wide-Analysis: A Wikipedia Deletion Discussion Analysis Suite'
163
- # desc = """ Wide-Analysis is a suite of tools for analyzing Wikipedia deletion discussions. It is designed to help researchers and practitioners to understand the dynamics of deletion discussions, and to develop tools for supporting the decision-making process in Wikipedia. The suite includes a set of tools for collecting, processing, and analyzing deletion discussions. The package contains the following functionalities
164
-
165
- # - Outcome Prediction: Predicting the outcome of a deletion discussion, the outcome can be the decision made with the discussion (e.g., keep, delete, merge, etc.) (determined from the complete discussion)
166
- # - Stance Detection: Identifying the stance of the participants in the discussion, in relation to the deletion decision.(determined from each individual comment in discussion)
167
- # - Policy Prediction: Predicting the policy that is most relevant to the comments of the participants in the discussion.(determined from each individual comment in discussion)
168
- # - Sentiment Prediction: Predicting the sentiment of the participants in the discussion, in relation to the deletion decision.(determined from each individual comment in discussion)
169
- # - Offensive Language Detection: Detecting offensive language in the comments of the participants in the discussion.(determined from each individual comment in discussion)
170
-
171
- # The input to the classifier is a URL of a Wikipedia deletion discussion page with the task listed in the drop-down box, and the output is the predicted label of the discussion, along with the probability of the predicted label, and the probabilities of all the labels.
172
-
173
- # """
174
-
175
- # url_input = gr.Textbox(label="URL")
176
- # model_name_input = gr.Dropdown(label="Choose the Task", choices=list(model_dict.keys()), value=list(model_dict.keys())[0])
177
- # outputs = [
178
- # gr.Textbox(label="Processed Text"),
179
- # gr.Textbox(label="Label with Highest Probability"), # This will only be used for the outcome task
180
- # gr.Textbox(label="Probability"), # This will only be used for the outcome task
181
- # gr.JSON(label="All Labels and Probabilities") # This will be used for all tasks
182
- # ]
183
-
184
- # demo = gr.Interface(fn=process_url, inputs=[url_input, model_name_input], outputs=outputs, title=title, description=desc)
185
- # demo.launch() # share=True
 
17
  lang_dict = ["en", "es", "gr"]
18
 
19
  title = 'Wide-Analysis: A Wikipedia Deletion Discussion Analysis Suite'
20
+ desc = """ Wide-Analysis is a suite of tools for analyzing deletion discussions across various Wikimedia platforms in multiple languages. The platform currently supports Outcome Prediction, Stance Detection, Policy Prediction, Sentiment Detection and Offensive Language Detection, for the languages English (en), Spanish (es), and Greek (gr) and the platforms: Wikipedia, Wikidata (entity and property), Wikinews, and Wikiquote.
21
+ The package contains the following functionalities
22
+
23
+ - Outcome Prediction: Predicting the outcome of a deletion discussion, the outcome can be the decision made with the discussion (e.g., keep, delete, merge, etc.) (determined from the complete discussion)
24
+ - Stance Detection: Identifying the stance of the participants in the discussion, in relation to the deletion decision.(determined from each individual comment in discussion)
25
+ - Policy Prediction: Predicting the policy that is most relevant to the comments of the participants in the discussion.(determined from each individual comment in discussion)
26
+ - Sentiment Prediction: Predicting the sentiment of the participants in the discussion, in relation to the deletion decision.(determined from each individual comment in discussion)
27
+ - Offensive Language Detection: Detecting offensive language in the comments of the participants in the discussion.(determined from each individual comment in discussion)
28
+
29
+ The input to the classifier is a URL of a Wikipedia deletion discussion page with the task, language and platform listed in the drop-down box, along with additional information for Greek language (gr), and the output is the predicted label of the discussion, along with the probability of the predicted label, and the probabilities of all the labels.
30
+
31
+ """
32
 
33
 
34
  def process_url(url, task_name, lang, platform, date):
 
112
  title=title,
113
  description=desc)
114
  demo.launch(share=True)