def get_sentences(doc):
    """Get the sentences, score and save them to .csv

    You will require to download the dataset (zip) from the following url:

    https://www.kaggle.com/rtatman/sentiment-lexicons-for-81-languages

    Once downloaded you will require to extract 2 .txt files:

    negative_words_es.txt
    positive_words_es.txt

    Parameters
    ----------
    doc : spacy.doc
        A doc object.

    """

    # Load positive and negative words into lists.
    with open("positive_words_es.txt", "r", encoding="utf-8") as temp_file:
        positive_words = temp_file.read().splitlines()

    with open("negative_words_es.txt", "r", encoding="utf-8") as temp_file:
        negative_words = temp_file.read().splitlines()

    data_list = [["text", "score"]]

    for sent in doc.sents:

        # Only take into account real sentences.
        if len(sent.text) > 10:

            score = 0

            # Start scoring the sentence.
            for word in sent:

                if word.lower_ in positive_words:
                    score += 1

                if word.lower_ in negative_words:
                    score -= 1

            data_list.append([sent.text, score])


    with open("./sentences.csv", "w", encoding="utf-8", newline="") as sentences_file:
        csv.writer(sentences_file).writerows(data_list)
Get the sentences, score and save them to .csv

    You will require to download the dataset (zip) from the following url:

    https://www.kaggle.com/rtatman/sentiment-lexicons-for-81-languages

    Once downloaded you will require to extract 2 .txt files:

    negative_words_es.txt
    positive_words_es.txt

    Parameters
    ----------
    doc : spacy.doc
        A doc object.

    
scripts/step2.py