Demea9000's picture
added __init__.py files so that we can import as modules
03f299a
from TextClassifier import TextClassifier
# Some examples of tweets:
data_dict = {
'25 years ago we made a promise to the people of Hong Kong. We intend to keep it. https://t.co/nIN96ZydgV': {
'hour': '17',
'nlikes': 7878,
'nreplies': 2999,
'nretweets': 1993,
'topic': '',
'sentiment': ''},
'A huge delight to meet @SwedishPM Magdalena Andersson and President @niinisto again. The accession of Finland '
'and Sweden to @NATO will permanently strengthen our defensive Alliance, helping to keep us all safe. #WeAreNATO '
' https://t.co/pArvdWHr2F': {
'hour': '16',
'nlikes': 3468,
'nreplies': 686,
'nretweets': 435,
'topic': '',
'sentiment': ''},
'At this @NATO Leaders’ Summit, I’ll be urging fellow nations to continue to do everything they can to support '
'Ukraine. The UK has always played a historic role in the @NATO alliance, working to address the biggest global '
'threats and build a more secure world.': {
'hour': '07',
'nlikes': 7742,
'nreplies': 1838,
'nretweets': 1112,
'topic': '',
'sentiment': ''},
'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.': {
'hour': '16',
'nlikes': 3468,
'nreplies': 686,
'nretweets': 435,
'topic': '',
'sentiment': ''},
'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.': {
'hour': '16',
'nlikes': 3468,
'nreplies': 686,
'nretweets': 435,
'topic': '',
'sentiment': ''},
'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' + '¯\_(ツ)_/¯': {
'hour': '16',
'nlikes': 3468,
'nreplies': 686,
'nretweets': 435,
'topic': '',
'sentiment': ''}
}
# Classify the TOPICS and insert the results into the data dictionary found above
topic_results = TextClassifier.classify_topics(data_dict)
# Classify the SENTIMENTS and insert the results into the data dictionary found above
sentiment_results = TextClassifier.classify_sentiments(data_dict)
# Print simple statistics related to TOPICS and SENTIMENTS
TextClassifier.print_stats(sentiment_results)