Spaces:
Runtime error
Runtime error
removed unused main.py file in textclassifier
Browse files- textclassifier/main.py +0 -58
textclassifier/main.py
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
from TextClassifier import TextClassifier
|
2 |
-
|
3 |
-
# Some examples of tweets:
|
4 |
-
data_dict = {
|
5 |
-
'25 years ago we made a promise to the people of Hong Kong. We intend to keep it. https://t.co/nIN96ZydgV': {
|
6 |
-
'hour': '17',
|
7 |
-
'nlikes': 7878,
|
8 |
-
'nreplies': 2999,
|
9 |
-
'nretweets': 1993,
|
10 |
-
'topic': '',
|
11 |
-
'sentiment': ''},
|
12 |
-
'A huge delight to meet @SwedishPM Magdalena Andersson and President @niinisto again. The accession of Finland '
|
13 |
-
'and Sweden to @NATO will permanently strengthen our defensive Alliance, helping to keep us all safe. #WeAreNATO '
|
14 |
-
' https://t.co/pArvdWHr2F': {
|
15 |
-
'hour': '16',
|
16 |
-
'nlikes': 3468,
|
17 |
-
'nreplies': 686,
|
18 |
-
'nretweets': 435,
|
19 |
-
'topic': '',
|
20 |
-
'sentiment': ''},
|
21 |
-
'At this @NATO Leaders’ Summit, I’ll be urging fellow nations to continue to do everything they can to support '
|
22 |
-
'Ukraine. The UK has always played a historic role in the @NATO alliance, working to address the biggest global '
|
23 |
-
'threats and build a more secure world.': {
|
24 |
-
'hour': '07',
|
25 |
-
'nlikes': 7742,
|
26 |
-
'nreplies': 1838,
|
27 |
-
'nretweets': 1112,
|
28 |
-
'topic': '',
|
29 |
-
'sentiment': ''},
|
30 |
-
'Morgan Johansson måste avgå som minister. Otryggheten biter sig fast och gängkriminaliteten är allt annat än knäckt. Antalet skjutningar ökar och sätter skräck i varje del av vårt land. Sverige har förvandlats till ett gangsterland.': {
|
31 |
-
'hour': '16',
|
32 |
-
'nlikes': 3468,
|
33 |
-
'nreplies': 686,
|
34 |
-
'nretweets': 435,
|
35 |
-
'topic': '',
|
36 |
-
'sentiment': ''},
|
37 |
-
'Döms man för brott, särskilt våldsbrott, ska man vara inlåst från det att domen faller tills straffet är avtjänat. Allt annat är vansinne.': {
|
38 |
-
'hour': '16',
|
39 |
-
'nlikes': 3468,
|
40 |
-
'nreplies': 686,
|
41 |
-
'nretweets': 435,
|
42 |
-
'topic': '',
|
43 |
-
'sentiment': ''},
|
44 |
-
'Motionerna: ' + '\n' + 'K339 avslogs av enig riksdag (inkl KD).' + '\n' + 'K220 avslogs av enig riksdag (inkl KD).' + '\n' + '1601 avslogs av enig riksdag (inkl KD).' + '\n' + 'K281 avslogs av enig riksdag (inkl KD).' + '\n' + '\n' + '¯\_(ツ)_/¯': {
|
45 |
-
'hour': '16',
|
46 |
-
'nlikes': 3468,
|
47 |
-
'nreplies': 686,
|
48 |
-
'nretweets': 435,
|
49 |
-
'topic': '',
|
50 |
-
'sentiment': ''}
|
51 |
-
}
|
52 |
-
|
53 |
-
# Classify the TOPICS and insert the results into the data dictionary found above
|
54 |
-
topic_results = TextClassifier.classify_topics(data_dict)
|
55 |
-
# Classify the SENTIMENTS and insert the results into the data dictionary found above
|
56 |
-
sentiment_results = TextClassifier.classify_sentiments(data_dict)
|
57 |
-
# Print simple statistics related to TOPICS and SENTIMENTS
|
58 |
-
TextClassifier.print_stats(sentiment_results)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|