MCPcopy Create free account

hub / github.com/Franck-Dernoncourt/NeuroNER / functions

Functions99 in github.com/Franck-Dernoncourt/NeuroNER

↓ 27 callersMethodclose
(self)
neuroner/neuromodel.py:820
↓ 4 callersFunctionplot_f1_vs_epoch
Takes results dictionary and saves the f1 vs epoch plot in stats_graph_folder. from_json indicates if the results dictionary was loaded from
neuroner/evaluate.py:63
↓ 3 callersMethodfit
Fit the model.
neuroner/neuromodel.py:593
↓ 3 callersMethodload_pretrained_token_embeddings
neuroner/entity_lstm.py:311
↓ 3 callersFunctionoutput_entities
(brat_output_folder, previous_filename, entities, text_filepath, text, overwrite=False)
neuroner/conll_to_brat.py:103
↓ 3 callersFunctionxml_to_brat
(input_folder, output_folder, overwrite=True)
neuroner/data/i2b2_2014_deid/xml_to_brat.py:16
↓ 2 callersFunction_clean_param_dtypes
Ensure data types are correct in the parameter dictionary. Args: param (dict): dictionary of parameter settings.
neuroner/neuromodel.py:172
↓ 2 callersMethod_convert_to_indices
(self, dataset_types)
neuroner/dataset.py:66
↓ 2 callersMethod_create_stats_graph_folder
Initialize stats_graph_folder. Args: parameters (type): description.
neuroner/neuromodel.py:493
↓ 2 callersFunction_fetch
Load data or models from the package folder. Args: name (str): name of the resource content_type (str): either "data" or "tr
neuroner/neuromodel.py:68
↓ 2 callersFunction_get_config_param
Get the parameters from the config file.
neuroner/neuromodel.py:154
↓ 2 callersMethod_get_valid_dataset_filepaths
Get paths for the datasets. Args: parameters (type): description. dataset_types (type): description.
neuroner/neuromodel.py:510
↓ 2 callersMethod_parse_dataset
(self, dataset_filepath)
neuroner/dataset.py:24
↓ 2 callersFunctionbidirectional_LSTM
neuroner/entity_lstm.py:12
↓ 2 callersFunctioncheck_bio_bioes_compatibility
(labels_bio, labels_bioes)
neuroner/utils_nlp.py:133
↓ 2 callersFunctionend_current_entity
Helper function for bio_to_bioes
neuroner/utils_nlp.py:86
↓ 2 callersFunctionget_entities_from_brat
(text_filepath, annotation_filepath, verbose=False)
neuroner/brat_to_conll.py:71
↓ 2 callersMethodload_embeddings_from_pretrained_model
neuroner/entity_lstm.py:363
↓ 2 callersFunctionoutput_conll_lines_with_bioes
Helper function for convert_conll_from_bio_to_bioes
neuroner/utils_nlp.py:169
↓ 2 callersFunctionremap_labels
y_pred: list of predicted labels y_true: list of gold labels evaluation_mode: 'bio', 'token', or 'binary' Both y_pred and y_true mus
neuroner/evaluate.py:155
↓ 2 callersFunctionremove_bio_from_label_name
(label_name)
neuroner/utils_nlp.py:74
↓ 1 callersMethod__del__
(self)
neuroner/neuromodel.py:823
↓ 1 callersMethod_check_param_compatibility
Check parameters are compatible. Args: parameters (type): description. dataset_filepaths (type): description
neuroner/neuromodel.py:583
↓ 1 callersFunction_get_default_param
Get the default parameters.
neuroner/neuromodel.py:103
↓ 1 callersFunctionassess_model
(y_pred, y_true, labels, target_names, labels_with_o, target_names_with_o, dataset_type, stats_graph_folder, e
neuroner/evaluate.py:13
↓ 1 callersFunctionbio_to_bioes
(labels)
neuroner/utils_nlp.py:97
↓ 1 callersFunctionbioes_to_bio
(labels)
neuroner/utils_nlp.py:117
↓ 1 callersFunctioncheck_param_compatibility
Check parameters are compatible.
neuroner/neuromodel.py:359
↓ 1 callersFunctioncheck_validity_of_conll_bioes
(bioes_filepath)
neuroner/utils_nlp.py:145
↓ 1 callersFunctioncm2inch
Specify figure size in centimeter in matplotlib Source: http://stackoverflow.com/a/22787457/395857 By gns-ank
neuroner/utils_plots.py:47
↓ 1 callersFunctionconll_to_brat
convert conll file in conll-filepath to brat annotations and output to brat_output_folder, with reference to the existing text files in brat
neuroner/conll_to_brat.py:120
↓ 1 callersMethoddefine_training_procedure
Define training procedure
neuroner/entity_lstm.py:284
↓ 1 callersFunctiongenerate_reference_text_file_for_conll
generates reference text files and adds the corresponding filename and token offsets to conll file. conll_input_filepath: path to a conl
neuroner/conll_to_brat.py:9
↓ 1 callersFunctionget_cmap
http://stackoverflow.com/questions/37517587/how-can-i-change-the-intensity-of-a-colormap-in-matplotlib
neuroner/utils_plots.py:15
↓ 1 callersFunctionget_current_time_in_seconds
http://stackoverflow.com/questions/415511/how-to-get-current-time-in-python
neuroner/utils.py:102
↓ 1 callersFunctionget_sentences_and_tokens_from_spacy
(text, spacy_nlp)
neuroner/brat_to_conll.py:18
↓ 1 callersFunctionget_sentences_and_tokens_from_stanford
(text, core_nlp)
neuroner/brat_to_conll.py:51
↓ 1 callersFunctionget_stanford_annotations
(text, core_nlp, port=9000, annotators='tokenize,ssplit,pos,lemma')
neuroner/brat_to_conll.py:40
↓ 1 callersFunctionget_start_and_end_offset_of_token_from_spacy
(token)
neuroner/brat_to_conll.py:13
↓ 1 callersFunctionheatmap
Inspired by: - http://stackoverflow.com/a/16124677/395857 - http://stackoverflow.com/a/25074150/395857
neuroner/utils_plots.py:59
↓ 1 callersMethodload_dataset
dataset_filepaths : dictionary with keys 'train', 'valid', 'test', 'deploy'
neuroner/dataset.py:149
↓ 1 callersFunctionload_parameters
Load parameters from the ini file if specified, take into account any command line argument, and ensure that each parameter is cast to the
neuroner/neuromodel.py:211
↓ 1 callersFunctionmain
NeuroNER main method Args: parameters_filepath the path to the parameters file output_folder the path to the output folder
neuroner/__main__.py:86
↓ 1 callersFunctionparse_arguments
Parse the NeuroNER arguments arguments: arguments the arguments, optionally given as argument
neuroner/__main__.py:18
↓ 1 callersFunctionprediction_step
Predict.
neuroner/train.py:41
↓ 1 callersFunctionprepare_pretrained_model_for_restoring
Copy the dataset.pickle, parameters.ini, and model checkpoint files after removing the data used for training. The dataset and labe
neuroner/prepare_pretrained_model.py:82
↓ 1 callersMethodrestore_from_pretrained_model
neuroner/entity_lstm.py:405
↓ 1 callersFunctionsave_results
Save results
neuroner/evaluate.py:56
↓ 1 callersFunctionshow_values
Heatmap with text in each cell with matplotlib's pyplot Source: http://stackoverflow.com/a/25074150/395857 By HYRY
neuroner/utils_plots.py:31
↓ 1 callersFunctiontrim_dataset_pickle
Remove the dataset and labels from dataset.pickle. If delete_token_mappings = True, then also remove token_to_index and index_to_token excep
neuroner/prepare_pretrained_model.py:18
↓ 1 callersFunctiontrim_model_checkpoint
Remove all token embeddings except UNK.
neuroner/prepare_pretrained_model.py:47
↓ 1 callersMethodupdate_dataset
dataset_filepaths : dictionary with keys 'train', 'valid', 'test', 'deploy' Overwrites the data of type specified in dataset_types us
neuroner/dataset.py:131
Method__init__
(self, **kwargs)
neuroner/neuromodel.py:456
Method__init__
(self, name='', verbose=False, debug=False)
neuroner/dataset.py:19
Method__init__
(self, dataset, parameters)
neuroner/entity_lstm.py:71
Functionbrat_to_conll
Assumes '.txt' and '.ann' files are in the input_folder. Checks for the compatibility between .txt and .ann at the same time.
neuroner/brat_to_conll.py:121
Functioncheck_brat_annotation_and_text_compatibility
Check if brat annotation and text files are compatible.
neuroner/brat_to_conll.py:105
Functioncheck_compatibility_between_conll_and_brat_text
check if token offsets match between conll and brat .txt files. conll_filepath: path to conll file brat_folder: folder that contains th
neuroner/conll_to_brat.py:58
Functioncheck_contents_of_dataset_and_model_checkpoint
Check the contents of dataset.pickle and model_xxx.ckpt. model_folder: folder containing dataset.pickle and model_xxx.ckpt to be checked.
neuroner/prepare_pretrained_model.py:134
Functionconvert_configparser_to_dictionary
http://stackoverflow.com/questions/1773793/convert-configparser-items-to-dictionary
neuroner/utils.py:115
Functionconvert_conll_from_bio_to_bioes
(input_conll_filepath, output_conll_filepath)
neuroner/utils_nlp.py:183
Functioncopytree
http://stackoverflow.com/questions/1868714/how-do-i-copy-an-entire-directory-of-files-into-an-existing-directory-using-pyth
neuroner/utils.py:130
Functioncreate_folder_if_not_exists
Create the folder if it doesn't exist already.
neuroner/utils.py:88
Functionevaluate_model
(results, dataset, y_pred_all, y_true_all, stats_graph_folder, epoch_number, epoch_start_time, output_filepath
neuroner/evaluate.py:223
Functionfetch_data
Fetch a dataset. If name is provided, fetch from the package folder. If url is provided, fetch from a remote location. Args: nam
neuroner/neuromodel.py:55
Functionfetch_model
Fetch a pre-trained model and copy to a local "trained_models" folder If name is provided, fetch from the package folder. Args:
neuroner/neuromodel.py:37
Methodfind_class
(self, module, name)
neuroner/utils.py:14
Functionget_basename_without_extension
Getting the basename of the filepath without the extension E.g. 'data/formatted/movie_reviews.pickle' -> 'movie_reviews'
neuroner/utils.py:81
Functionget_current_milliseconds
http://stackoverflow.com/questions/5998245/get-current-time-in-milliseconds-in-python
neuroner/utils.py:95
Functionget_current_time_in_miliseconds
http://stackoverflow.com/questions/5998245/get-current-time-in-milliseconds-in-python
neuroner/utils.py:108
Functionget_parameter_to_section_of_configparser
(config)
neuroner/utils.py:122
Methodget_params
(self)
neuroner/neuromodel.py:817
Functionget_parsed_conll_output
(conll_output_filepath)
neuroner/utils_nlp.py:53
Functionget_valid_dataset_filepaths
Get valid filepaths for the datasets.
neuroner/neuromodel.py:286
Functionis_token_in_pretrained_embeddings
(token, all_pretrained_tokens, parameters)
neuroner/utils_nlp.py:46
Functionload_pretrained_token_embeddings
(parameters)
neuroner/utils_nlp.py:29
Functionload_tokens_from_pretrained_token_embeddings
(parameters)
neuroner/utils_nlp.py:12
Functionmerge_dictionaries
http://stackoverflow.com/questions/38987/how-can-i-merge-two-python-dictionaries-in-a-single-expression Given any number of dicts, shallow co
neuroner/utils.py:62
Functionorder_dictionary
Order a dictionary by 'key' or 'value'. mode should be either 'key' or 'value' http://stackoverflow.com/questions/613183/sort-a-python-di
neuroner/utils.py:25
Functionoutput_brat
(output_filepaths, dataset_brat_folders, stats_graph_folder, overwrite=False)
neuroner/conll_to_brat.py:241
Functionpad_list
http://stackoverflow.com/questions/3438756/some-built-in-to-pad-a-list-in-python Example: pad_list([6,2,3], 5, 0) returns [6,2,3,0,0]
neuroner/utils.py:73
Functionplot_barh
(x, y, xlabel, ylabel, title, graph_path)
neuroner/utils_plots.py:182
Functionplot_classification_report
Plot scikit-learn classification report. Extension based on http://stackoverflow.com/a/31689645/395857
neuroner/utils_plots.py:130
Functionplot_hist
(sequence, xlabel, ylabel, title, graph_path)
neuroner/utils_plots.py:167
Functionplot_precision_recall_curve
(recall, precision, graph_path, title)
neuroner/utils_plots.py:200
Functionplot_roc_curve
(fpr, tpr, graph_path, title)
neuroner/utils_plots.py:213
Functionplot_threshold_vs_accuracy_curve
(accuracies, thresholds, graph_path, title)
neuroner/utils_plots.py:226
Methodpredict
Predict Args: text (str): Description.
neuroner/neuromodel.py:753
Functionpredict_labels
Predict labels using trained model
neuroner/train.py:159
Functionrenamed_load
(file_obj)
neuroner/utils.py:22
Functionreplace_unicode_whitespaces_with_ascii_whitespace
(string)
neuroner/utils_nlp.py:82
Functionresize_tensor_variable
(sess, tensor_variable, shape)
neuroner/utils_tf.py:18
Functionresult_to_plot
Loads results.json file in the ../stats_graphs/folder_name, and plot f1 vs epoch. Use for debugging purposes, or in case the program stopped
neuroner/evaluate.py:134
Functionreverse_dictionary
http://stackoverflow.com/questions/483666/python-reverse-inverse-a-mapping http://stackoverflow.com/questions/25480089/right-way-to-initializ
neuroner/utils.py:50
MethodsetUp
(self)
test/test_main.py:16
MethodtearDown
(self)
test/test_main.py:21
Methodtest_ProvideOutputDir_CorrectlyOutputsToDir
Sanity test to check if all proper model output files are created in the output folder
test/test_main.py:26
Functiontrain_step
Train.
neuroner/train.py:16
Functionvariable_summaries
Attach a lot of summaries to a Tensor (for TensorBoard visualization). From https://www.tensorflow.org/get_started/summaries_and_tensorboard
neuroner/utils_tf.py:3