Process finished with exit code -1073740940 (0xC0000374)_python

2

After tweeter scraping, I am going to do 'morphological analysis'. But an error occurs.

"Process finished with exit code -1073740940 (0xC0000374)"

How do I fix the code? Please advise. Thank you for your advice.

from konlpy.tag import Twitter
from collections import Counter


def get_tags(text, ntags=50):
    spliter = Twitter()
    nouns = spliter.nouns(text)
    count = Counter(nouns)
    return_list = []
    for n, c in count.most_common(ntags):
        temp = {'tag': n, 'count': c}
        return_list.append(temp)
    return return_list


def main():
    text_file_name = '11.txt' 
    noun_count = 30
    output_file_name = '6767.txt' 
    open_text_file = open(text_file_name, 'r',-1,"utf-8")
    text = open_text_file.read()
    tags = get_tags(text, noun_count)
    open_text_file.close()
    open_output_file = open(output_file_name, 'w',-1,"utf-8")
    for tag in tags:
        noun = tag['tag']
        count = tag['count']
        open_output_file.write('{} {}\n'.format(noun, count))
    open_output_file.close()


if __name__ == '__main__':
     main()
python
twitter
asked on Stack Overflow May 15, 2017 by koko

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0