Exemplo n.º 1
0
import math
from tslearn.clustering import TimeSeriesKMeans
from sklearn.metrics import mean_absolute_error
from sklearn.cluster import KMeans
from paper_class import paper

papers = {}

with open("datasets_inUse/paper_ids.txt", "r", encoding="utf8") as file:
    pid = 0
    for i in file.readlines():
        l = i.split()
        # making the entire title sentence
        title = ' '.join(l[1:len(l) - 1])
        # paper id pid is increasing values of 1 with eveyr loop
        papers[l[0]] = paper(pid, l[0], title, l[-1], "", "")
        pid += 1

with open("datasets_inUse/acl-metadata.txt", "r", encoding="utf8") as file:
    pid = 0
    flag = False
    ID = 0
    for i in file.readlines():
        #print(i)
        l = i.split('=')
        if (flag):
            if (l[0] == "author "):
                l[1] = l[1].strip()
                auth = l[1][1:-1]
                #print(auth)
                papers[ID].author = auth
Exemplo n.º 2
0
from paper_class import paper
import copy
import nimfa
paper_id={}
id_paper={}
inverse_id={}

with open("datasets_inUse/paper_ids.txt","r", encoding="utf8") as file:
    pid=0
    for i in file.readlines():
        l=i.split()
        # making the entire title sentence
        title=' '.join(l[1:len(l)-1])
        # paper id pid is increasing values of 1 with eveyr loop
        obj=paper(pid, l[0], title, l[-1],[],"")
        paper_id[l[0]]=obj
        id_paper[pid]=obj
        inverse_id[pid]=l[0]
        pid+=1
 #%%
with open("datasets_inUse/acl-metadata.txt","r", encoding="utf8") as file:
    pid=0
    paper=""
    for i in file.readlines():
        if(i!='\n'):
            l=i.split('=')
            if(l[0]=="id "):
                l[1]=l[1].strip()
                paper=l[1][1:-1]
            if(l[0]=="author "):