Skip to content

Commit

Permalink
[fix] kkma.post()에 빈 문자열 들어가지 않게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightieey committed Oct 10, 2023
1 parent fdbb1ef commit dbd3008
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions extract_keyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ def get_keyword(application):

output = list()
for sample in data:
ex_pos = kkma.pos(sample)
text_data = []
for (text, tclass) in ex_pos:
if tclass == 'NNG' or tclass == 'NNP' or tclass == 'VV' or tclass == 'VA' or tclass == 'OL' or tclass == 'MAG':
text_data.append(text)
output.append(text_data)
if sample.strip():
ex_pos = kkma.pos(sample)
text_data = []
for (text, tclass) in ex_pos:
if tclass == 'NNG' or tclass == 'NNP' or tclass == 'VV' or tclass == 'VA' or tclass == 'OL' or tclass == 'MAG':
text_data.append(text)
output.append(text_data)

corpus = list(map(lambda x: ' '.join(x), output))

Expand Down

0 comments on commit dbd3008

Please sign in to comment.