forked from jeochris/App-Review-Sentiment-Summarization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (25 loc) · 1.07 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import argparse
from crawler import Crawler
from preprocess import Preprocess
from kobert_classifier import FineTuned_KoBERT
from topic_summary import Topic_Modeling
def main():
parser = argparse.ArgumentParser(description='Baseline')
parser.add_argument('--app_name', type=str, metavar='app_name', help='App Name')
parser.add_argument('--rating', type=str, metavar='rating', help='Target Rating')
parser.add_argument('--sentiment', type=str, metavar='sentiment', help='Target Sentiment')
args = parser.parse_args()
# print(args.sentiment) # positive, negative, personal
# crawl reviews
crawler = Crawler(args.app_name, args.rating)
crawler.crawl()
# preprocess
preprocess = Preprocess(crawler.review_dict_total)
preprocess.preprocess()
classifier = FineTuned_KoBERT(preprocess.result_sentences_df, args.app_name)
classifier.inference()
topic_modeling = Topic_Modeling(classifier.result, args.sentiment, args.app_name, args.rating)
topic_modeling.retrive_topic()
topic_modeling.summary()
if __name__ == '__main__':
main()