Ejemplo n.º 1
0
def loadSentiment_value(catalog):

    valueSentimentFile = cf.data_dir + 'sentiment_values.csv'
    input_file = csv.DictReader(open(valueSentimentFile, encoding='utf-8'),
                                delimiter=",")
    for valuesent in input_file:
        model.addSentiment(catalog, valuesent)
Ejemplo n.º 2
0
def loadSentiments(analyzer):
    sentimentsfile = cf.data_dir + 'sentiment_values.csv'
    input_file = csv.DictReader(open(sentimentsfile, encoding="utf-8"),
                                delimiter=",")
    for sentiment in input_file:
        model.addSentiment(analyzer, sentiment)
    return analyzer
Ejemplo n.º 3
0
def loadSentiment(analyzer):
    """
    Carga los valores de sentimientos del archivo csv.
    """
    sentimentsfile = cf.data_dir + 'subsamples-small/sentiment_values.csv'
    input_file = csv.DictReader(open(sentimentsfile, encoding='utf-8'))
    for sentimentValue in input_file:
        model.addSentiment(analyzer, sentimentValue)
Ejemplo n.º 4
0
def loadData(catalog):
    TSfile = cf.data_dir + 'user_track_hashtag_timestamp-small.csv'
    ts_sub = csv.DictReader(open(TSfile, encoding='utf-8'))

    for register in ts_sub:
        model.createmap2file(catalog, register, 'track')

    HVfile = cf.data_dir + 'sentiment_values.csv'
    sv_file = csv.DictReader(open(HVfile, encoding='utf-8'))

    for pair in sv_file:
        model.addSentiment(catalog, pair)

    Dfile = cf.data_dir + 'context_content_features-small.csv'
    main_file = csv.DictReader(open(Dfile, encoding='utf-8'))
    for event in main_file:
        model.addEvent(catalog, event)
Ejemplo n.º 5
0
def loadData(analyzer, hashtag, sentiments, context):
    """
    Carga los datos de los archivos CSV en el modelo
    """
    hashtagsfile = cf.data_dir + hashtag
    hashtag_file = csv.DictReader(open(hashtagsfile, encoding="utf-8"),
                                  delimiter=",")
    contextfile = cf.data_dir + context
    context_file = csv.DictReader(open(contextfile, encoding="utf-8"),
                                  delimiter=",")
    sentimentsfile = cf.data_dir + sentiments
    sentiments_file = csv.DictReader(open(sentimentsfile, encoding="utf-8"),
                                     delimiter=",")
    for event in context_file:
        model.addEvent(analyzer, event)
    posEvent = 1
    for hastag in hashtag_file:
        posEvent = model.addHashtag(analyzer, hastag, posEvent)

    model.crearArboles(analyzer)

    for sentiment in sentiments_file:
        model.addSentiment(analyzer, sentiment)
    return analyzer
Ejemplo n.º 6
0
def loadSentiment(catalog):
    sfile = cf.data_dir + 'subsamples-small/sentiment_values.csv'
    input_file = csv.DictReader(open(sfile, encoding='utf-8'), delimiter=",")
    for line in input_file:
        model.addSentiment(catalog, line)
def loadSentiment(cat, sentiment):
    sfile = cf.data_dir + "subsamples-small" + "\\" + sentiment
    input_file = csv.DictReader(open(sfile, encoding="utf-8"), delimiter=",")
    for sent in input_file:
        model.addSentiment(cat, sent)
    print("Se cargó el archivo de Sentiment Values")