<filename>test.py<gh_stars>0
# -*- coding: utf-8 -*-
import getRumors
import oseti
import createFile


def main():
    analyzer = oseti.Analyzer()
    rumors = getRumors.getRumors(
        "2020-09-01", "2020-09-07", 2000)  # id, content
    poss = []
    negs = []
    neus = []
    for r in rumors:
        nums = analyzer.analyze(r["content"])
        score = sum(nums) / len(nums)
        if(score > 0):
            poss.append(r["content"])
        elif(score == 0):
            neus.append(r["content"])
        elif(score < 0):
            negs.append(r["content"])
    createFile.createFile(poss, "ex_pos")
    createFile.createFile(neus, "ex_neus")
    createFile.createFile(negs, "ex_negs")
    print("sccess!")


main()

<filename>test.py<gh_stars>0
# -*- coding: utf-8 -*-
import getRumors
import oseti
import createFile


def main():
    analyzer = oseti.Analyzer()
    rumors = getRumors.getRumors(
        "2020-09-01", "2020-09-07", 2000)  # id, content
    poss = []
    negs = []
    neus = []
    for r in rumors:
        nums = analyzer.analyze(r["content"])
        score = sum(nums) / len(nums)
        if(score > 0):
            poss.append(r["content"])
        elif(score == 0):
            neus.append(r["content"])
        elif(score < 0):
            negs.append(r["content"])
    createFile.createFile(poss, "ex_pos")
    createFile.createFile(neus, "ex_neus")
    createFile.createFile(negs, "ex_negs")
    print("sccess!")


main()

# -*- coding: utf-8 -*- # id, content