Showing
1 changed file
with
5 additions
and
3 deletions
... | @@ -25,8 +25,6 @@ def GetKeywords(): | ... | @@ -25,8 +25,6 @@ def GetKeywords(): |
25 | with open(os.path.join(BASE_DIR + '/', 'data.csv'), 'r', encoding='utf-8') as db: | 25 | with open(os.path.join(BASE_DIR + '/', 'data.csv'), 'r', encoding='utf-8') as db: |
26 | reader = csv.reader(db) | 26 | reader = csv.reader(db) |
27 | for data in reader: | 27 | for data in reader: |
28 | - data[0] = re.sub(pattern='[^\w\s]', repl='', string=data[0]).replace('\n', '') | ||
29 | - data[1] = re.sub(pattern='[^\w\s]', repl='', string=data[1]).replace('\n', '') | ||
30 | posts.append(data[0] + data[1]) | 28 | posts.append(data[0] + data[1]) |
31 | 29 | ||
32 | keyword_extractor = KeywordSummarizer( | 30 | keyword_extractor = KeywordSummarizer( |
... | @@ -36,4 +34,8 @@ def GetKeywords(): | ... | @@ -36,4 +34,8 @@ def GetKeywords(): |
36 | ) | 34 | ) |
37 | 35 | ||
38 | keywords = keyword_extractor.summarize(posts, topk=30) | 36 | keywords = keyword_extractor.summarize(posts, topk=30) |
39 | - return keywords | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
37 | + print(keywords) | ||
38 | + exit() | ||
39 | + return keywords | ||
40 | + | ||
41 | +GetKeywords() | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment