Ejemplo n.º 1
0
    elif SearchField[field] == SearchField.POSTAG:
        new_entry = tk.OptionMenu(
            window, searched_term, '*', 'JJ* - Any adjective',
            'NN* - Any noun', 'VB* - Any verb',
            *sorted([
                k + " - " + v
                for k, v in Stanford_CoreNLP_tags_util.dict_POSTAG.items()
            ]))
        searched_term.set('*')

    else:
        new_entry = tk.Entry(window, textvariable=searched_term)
        searched_term.set('')

    GUI_IO_util.placeWidget(GUI_IO_util.get_open_file_directory_coordinate(),
                            y_multiplier_for_searched_term, new_entry)
    entry_searchField_kw.destroy()
    entry_searchField_kw = new_entry


searchedCoNLLField.trace('w', on_searched_field_change)

readMe_message = "This Python 3 script allows you to search in the CoNLL table."
readMe_command = lambda: GUI_IO_util.readme_button(
    window, GUI_IO_util.get_help_button_x_coordinate(),
    GUI_IO_util.get_basic_y_coordinate(), "Help", readMe_message)
GUI_util.GUI_bottom(config_input_output_options, y_multiplier_integer + 5,
                    readMe_command, {'None': 'None'}, 'None')

GUI_util.window.mainloop()
Ejemplo n.º 2
0
        "lib"
        " SUBFOLDER OF THE FOLDER WHERE THE Sentiment_Analysis_VADER.py SCRIPT IS STORED.\n\nIn OUTPUT, the script creates a csv file containing the calculated 'compound' sentiment values for each sentence.\n\nMean and Median calculations are not available for VADER; VADER computes 'compound' values for each sentence.\n\nSentiment values are classified on a scale -1 (most negative) to 1 as (most positive) grouped in 3 categories: negative (<-0.05), neutral (>=-0.05 and <=0.05), and positive (>0.05 and <=1).\n\nVADER heavily relies on a number of NLTK libraries. If VADER fails to run, make sure that in command line you run\n   python -m nltk.downloader all"
    )
    GUI_IO_util.place_help_button(
        window, help_button_x_coordinate, basic_y_coordinate + y_step * 5,
        "Help",
        "Please, tick the checkboxes to display a line plot of sentiment scores by sentence index across a specific document."
    )
    GUI_IO_util.place_help_button(
        window, help_button_x_coordinate, basic_y_coordinate + y_step * 6,
        "Help",
        "Please, tick the checkboxes to open a specific GUI to compute the \'shape of stories\' of a set of sentiment scores across different documents."
    )
    GUI_IO_util.place_help_button(window, help_button_x_coordinate,
                                  basic_y_coordinate + y_step * 7, "Help",
                                  GUI_IO_util.msg_openOutputFiles)


help_buttons(window, GUI_IO_util.get_help_button_x_coordinate(),
             GUI_IO_util.get_basic_y_coordinate(), GUI_IO_util.get_y_step())

# change the value of the readMe_message
readMe_message = "The Python 3 Dictionary-based Analyses scripts calculate the mean/median values for various aspects of the language used in a text: sentiment, arousal, dominance.\n\nIn INPUT the scripts expect either a single text file or a set of text files stored in a directory. THE hedonometer, ANEW, AND VADER SCRIPTS ALSO EXPECT TO FIND DICTIONARY FILES IN A " "lib" " SUBFOLDER OF THE FOLDER WHERE THE PYTHON SCRIPTS ARE STORED.\n\nIn OUTPUT, the scripts create csv files containing the calculated mean/median values for each sentence."
readMe_command = lambda: GUI_IO_util.readme_button(
    window, GUI_IO_util.get_help_button_x_coordinate(),
    GUI_IO_util.get_basic_y_coordinate(), "Help", readMe_message)
GUI_util.GUI_bottom(config_input_output_options, y_multiplier_integer,
                    readMe_command, TIPS_lookup, TIPS_options)

GUI_util.window.mainloop()
Ejemplo n.º 3
0
# Written by Yuhang Feng November 2019
# Edited by Roberto Franzosi
import sys
import GUI_util
import IO_libraries_util
if IO_libraries_util.install_all_packages(GUI_util.window, "Excel_charts.py",
                                          ['os', 'tkinter']) == False:
    sys.exit(0)
import tkinter.messagebox as mb
import tkinter as tk
import GUI_util
import GUI_IO_util
import IO_files_util
import IO_user_interface_util
import Excel_util
import IO_csv_util
# RUN section ______________________________________________________________________________________________________________________________________________________

def run(input_file_name, output_dir, openOutputFiles, selected_series,
        column_xAxis_label_var, column_yAxis_label_var, count_var,
        column_yAxis_field_list, second_y_var, second_y_var_list,
        second_yAxis_label_var, chart_type, chart_type_list, chart_title,
        hover_var_list, hover_info_column_list):
    filesToOpen = []  # Store all files that are to be opened once finished
    if len(chart_type) == 0:
        mb.showwarning(
            title='Chart type error',
            message=
            "No chart type was specified (e.g., line, bubble). The chart cannot be created. Please, select a chart type and try again!"
        )