<commit_before>from nltk.sentiment.vader import SentimentIntensityAnalyzer
from nltk.tokenize import sent_tokenize
import pandas as pd
import numpy as np
import os

BASE_PATH = os.path.dirname(os.path.abspath(__file__))

sid = SentimentIntensityAnalyzer()

def analyze(file):
    df = pd.read_csv(file)
    # d = iris.head()['date']
    sent = {}
    pos = []
    neg = []
    com = []
    neu = []
    print(len(df))
    i = 0
    for date, data in df.iterrows():
        i+=1
        sent[i] = sid.polarity_scores(str(data['data']))
        pos.append(sent[i]['pos'])
        neg.append(sent[i]['neg'])
        neu.append(sent[i]['neu'])
        com.append(sent[i]['compound'])

    df['positive'] = pos
    df['negative'] = neg<commit_msg>cleaned file<commit_after>from nltk.sentiment.vader import SentimentIntensityAnalyzer
from nltk.tokenize import sent_tokenize
import pandas as pd
import numpy as np
import os

BASE_PATH = os.path.dirname(os.path.abspath(__file__))

sid = SentimentIntensityAnalyzer()

def analyze(file):
    df = pd.read_csv(file)
    sent = {}
    pos = []
    neg = []
    com = []
    neu = []
    print(len(df))
    i = 0
    for date, data in df.iterrows():
        i+=1
        sent[i] = sid.polarity_scores(str(data['data']))
        pos.append(sent[i]['pos'])
        neg.append(sent[i]['neg'])
        neu.append(sent[i]['neu'])
        com.append(sent[i]['compound'])

    df['positive'] = pos
    df['negative'] = neg
{'fraction_non_alphanumeric': 0.15760495526496904, 'fraction_numerical': 0.0027529249827942187, 'mean_word_length': 3.005509641873278, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7504703', 'n_tokens_mistral': 520, 'n_tokens_neox': 509, 'n_words': 102}