utilsΒΆ

Functions

build_embedding_matrix

Helper method to generate an embedding matrix.

download_tokenizer_files

Helper method to download files from online storage.

download_url_file

Helper method to download and save url file.

generate_dependency_adj_matrix

Helper method to generate senticnet depdency adj matrix.

load_and_process_senticnet

Helper method to load and process senticnet.

load_word_vec

Helper method to load word vectors from file (e.g.

pad_and_truncate

Helper method for padding and truncating text and aspect segment.

parse_args_and_load_config

Get config from config file using argparser

set_random_seed

Helper method to set random seeds for python, numpy and torch

Classes

BucketIterator

Iterator class for use with non-bert version of SenticGCN.

SenticGCNDataset

Data class for SenticGCN dataset.

SenticGCNDatasetGenerator

Main dataset generator class to preprocess raw dataset file.