import json
import jieba
files = ["companynews.txt", "cpinews.txt", "estatenews.txt", "gdpnews.txt", "industrynews.txt", "marketnews.txt",
         "ppinews.txt", "rmbnews.txt"]
def collectFiles():
    with open("allnews.txt", mode="w", encoding="utf-8") as allf:
        for file in files:
            with open(file, encoding="utf-8") as f:
                for line in f:
                    news = json.loads(line)
                    content = " ".join(jieba.cut(news["content"]))
                    allf.write(content + " __label__" + news["type"] + "\n")
collectFiles()

6f190d89a1b29976e174fab313fa48b79b826960
<mask token>


def collectFiles():
    with open('allnews.txt', mode='w', encoding='utf-8') as allf:
        for file in files:
            with open(file, encoding='utf-8') as f:
                for line in f:
                    news = json.loads(line)
                    content = ' '.join(jieba.cut(news['content']))
                    allf.write(content + ' __label__' + news['type'] + '\n')


<mask token>

<mask token>


def collectFiles():
    with open('allnews.txt', mode='w', encoding='utf-8') as allf:
        for file in files:
            with open(file, encoding='utf-8') as f:
                for line in f:
                    news = json.loads(line)
                    content = ' '.join(jieba.cut(news['content']))
                    allf.write(content + ' __label__' + news['type'] + '\n')


collectFiles()

<mask token>
files = ['companynews.txt', 'cpinews.txt', 'estatenews.txt', 'gdpnews.txt',
    'industrynews.txt', 'marketnews.txt', 'ppinews.txt', 'rmbnews.txt']


def collectFiles():
    with open('allnews.txt', mode='w', encoding='utf-8') as allf:
        for file in files:
            with open(file, encoding='utf-8') as f:
                for line in f:
                    news = json.loads(line)
                    content = ' '.join(jieba.cut(news['content']))
                    allf.write(content + ' __label__' + news['type'] + '\n')


collectFiles()

import json
import jieba
files = ['companynews.txt', 'cpinews.txt', 'estatenews.txt', 'gdpnews.txt',
    'industrynews.txt', 'marketnews.txt', 'ppinews.txt', 'rmbnews.txt']


def collectFiles():
    with open('allnews.txt', mode='w', encoding='utf-8') as allf:
        for file in files:
            with open(file, encoding='utf-8') as f:
                for line in f:
                    news = json.loads(line)
                    content = ' '.join(jieba.cut(news['content']))
                    allf.write(content + ' __label__' + news['type'] + '\n')


collectFiles()

import json
import jieba
files = ["companynews.txt", "cpinews.txt", "estatenews.txt", "gdpnews.txt", "industrynews.txt", "marketnews.txt",
         "ppinews.txt", "rmbnews.txt"]
def collectFiles():
    with open("allnews.txt", mode="w", encoding="utf-8") as allf:
        for file in files:
            with open(file, encoding="utf-8") as f:
                for line in f:
                    news = json.loads(line)
                    content = " ".join(jieba.cut(news["content"]))
                    allf.write(content + " __label__" + news["type"] + "\n")
collectFiles()
