Project dependencies may have API risk issues
PyDeps opened this issue · 0 comments
Hi, In NeuroNER, inappropriate dependency versioning constraints can cause risks.
Below are the dependencies and version constraints that the project is using
matplotlib==3.0.2
networkx==2.2
pycorenlp==0.3.0
scikit-learn==0.20.2
scipy==1.2.0
spacy==2.0.18
tensorflow==1.1.0
numpy==1.16.0
The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict.
The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.
After further analysis, in this project,
The version constraint of dependency matplotlib can be changed to >=1.3.0,<=3.0.3.
The version constraint of dependency networkx can be changed to >=2.0,<=2.8.4.
The version constraint of dependency scikit-learn can be changed to >=0.15.0,<=0.20.4.
The version constraint of dependency spacy can be changed to >=0.100.0,<=3.3.1.
The above modification suggestions can reduce the dependency conflicts as much as possible,
and introduce the latest version as much as possible without calling Error in the projects.
The invocation of the current project includes all the following methods.
The calling methods from the matplotlib
matplotlib.colors.ListedColormap matplotlib.cm.get_cmap matplotlib.use
The calling methods from the networkx
max
The calling methods from the scikit-learn
sklearn.preprocessing.LabelBinarizer.fit sklearn.preprocessing.LabelBinarizer.transform sklearn.metrics.precision_recall_fscore_support sklearn.preprocessing.normalize random.choice sklearn.metrics.confusion_matrix sklearn.metrics.classification_report sklearn.preprocessing.LabelBinarizer sklearn.metrics.f1_score sklearn.metrics.accuracy_score
The calling methods from the spacy
spacy.load
The calling methods from the all methods
distutils.util.strtobool neuroner.conll_to_brat.conll_to_brat plot_handles.extend neuroner.neuromodel.fetch_data numpy.arange bioes_filepath.utils.get_basename_without_extension.split self.unique_label_indices_of_interest.append matplotlib.pyplot.axvline tensorflow.python.tools.inspect_checkpoint.print_tensors_in_checkpoint_file tensorflow.contrib.tensorboard.plugins.projector.ProjectorConfig tensorflow.stack pprint.pprint tensorflow.constant neuroner.utils.get_parameter_to_section_of_configparser self._parse_dataset pkg_resources.resource_isdir collections.OrderedDict token_dict.split argparse.ArgumentParser.print_help get_current_time_in_seconds sorted.append input_conll_filepath.utils.get_basename_without_extension.split annotation_filepath.codecs.open.close conll_to_brat numpy.histogram os.path.abspath dataset_type.character_indices_padded.append json.dump random.choice.split f.write neuroner.utils_nlp.is_token_in_pretrained_embeddings neuroner.utils.get_basename_without_extension config.sections p.vertices.mean time.strftime self.index_to_label.keys neuroner.utils_nlp.load_pretrained_token_embeddings token.split self.tokens_mapped_to_unk.append tensorflow.name_scope type os.makedirs codecs.open os.path.getsize pretraining_string_to_index.keys numpy.linspace str neuroner.brat_to_conll.check_brat_annotation_and_text_compatibility matplotlib.pyplot.gca.set_xticklabels sess.run matplotlib.pyplot.gca.text AssertionError matplotlib.pyplot.clf json.load line.str.replace tensorflow.argmax neuroner.evaluate.save_results output_conll_lines_with_bioes tensorflow.train.Saver.save neuroner.utils.reverse_dictionary.keys dataset_filepaths.get _get_default_param.items sorted.add os.path.isfile pickle.load dataset_filepaths.keys support.append line.split.replace split_lines.append all_y_true.extend shutil.rmtree matplotlib.pyplot.gcf.set_size_inches get_sentences_and_tokens_from_stanford.append neuroner.train.predict_labels unary_scores.tolist self.index_to_character.keys tensorflow.nn.embedding_lookup tensorflow.square matplotlib.pyplot.xlabel entity_lstm.EntityLSTM neuroner.evaluate.evaluate_model line.strip self.dataset_filepaths.update tensorflow.nn.tanh tokens.append sorted.sort tensorflow.expand_dims writers.add_summary tensorflow.zeros neuroner.train.prediction_step neuroner.neuromodel.fetch_model input_filepath.xml.etree.ElementTree.parse.getroot line.split.strip matplotlib.pyplot.gca.set_yticks matplotlib.pyplot.title vars matplotlib.pyplot.gca.invert_yaxis epoch_number.results.append kwargs.items self.character_indices.update labels_bioes.append neuroner.dataset.Dataset codecs.open.write argparse.ArgumentParser self.token_embedding_weights.assign self.token_embedding_weights.read_value neuroner.utils.pad_list cm2inch generate_reference_text_file_for_conll line.strip.replace writers.flush labels_bio.append line.strip.split.strip os.path.splitext neuroner.utils_nlp.bioes_to_bio matplotlib.pyplot.figure matplotlib.colors.ListedColormap file_obj.RenameUnpickler.load self.saver.restore sklearn.metrics.classification_report filepath.os.path.basename.replace datetime.datetime.now end_current_entity tensorflow.reduce_mean dataset_type.token_lengths.append map argparse.ArgumentParser.add_argument self.model.load_pretrained_token_embeddings remove_bio_from_label_name self.load_pretrained_token_embeddings l.rstrip.replace.replace.replace.strip.split tensorflow.summary.histogram get_entities_from_brat self._create_stats_graph_folder tensorflow.Variable self.sess.close self.optimizer.compute_gradients config.items round tag.get matplotlib.pyplot.ylabel self.index_to_token.keys self.load_embeddings_from_pretrained_model check_validity_of_conll_bioes tensorflow.summary.FileWriter get_sentences_and_tokens_from_stanford os.path.exists dataset_type.character_indices.append dataset_types.append os.path.join sys.exit plotMat.append document_count.str.zfill shutil.copytree os.system pycorenlp.StanfordCoreNLP token_dict.strip tensorflow.Session tensorflow.tile _get_default_param ax.yaxis.get_major_ticks _clean_param_dtypes.items bio_to_bioes sorted matplotlib.pyplot.bar neuroner.utils_plots.heatmap tensorflow.variable_scope labels.y_pred.y_true.sklearn.metrics.precision_recall_fscore_support.tolist print line.strip.split.pop tensorflow.reduce_max numpy.copy.flatten pc.update_scalarmappable matplotlib.pyplot.xlim output_file.write bidirectional_LSTM numpy.fill_diagonal IOError tensorflow.contrib.rnn.CoupledInputForgetGateLSTMCell tensorflow.clip_by_value neuroner.conll_to_brat.output_brat all_predictions.extend line.split matplotlib.pyplot.plot os.path.relpath tensorflow.assign open l.rstrip.replace.replace self.model.restore_from_pretrained_model self.modeldata.update_dataset sklearn.metrics.confusion_matrix.tolist collections.defaultdict.items self.dataset_brat_folders.update sorted.remove assess_model matplotlib.cm.get_cmap dataset_type.writers.close tensorflow.nn.bidirectional_dynamic_rnn len _get_config_param get_stanford_annotations shutil.copyfile embedding_weights.read_value neuroner.neuromodel.load_parameters xml_to_brat neuroner.utils_nlp.load_pretrained_token_embeddings.keys tensorflow.contrib.rnn.LSTMStateTuple tensorflow.contrib.layers.xavier_initializer plot_handles.append token.strip matplotlib.pyplot.gcf param_config.items matplotlib.pyplot.gca.barh neuroner.utils.convert_configparser_to_dictionary tensorflow.summary.scalar dataset_type.token_indices.append matplotlib.pyplot.subplots neuroner.brat_to_conll.get_entities_from_brat numpy.random.rand self.characters.update self._get_valid_dataset_filepaths tensorflow.contrib.crf.viterbi_decode prepare_pretrained_model_for_restoring os.listdir new_token_sequence.append range predictions.tolist.tolist neuroner.neuromodel.NeuroNER.close dataset_type.characters.append matplotlib.pyplot.grid _clean_param_dtypes pc.get_array tensorflow.global_variables_initializer dataset_type.label_indices.append neuroner.utils.convert_configparser_to_dictionary.items pretraining_dataset.label_to_index.keys self.define_training_procedure labels.append random.shuffle tensorflow.reduce_min pretraining_dataset.index_to_token.values cmap tensorflow.nn.xw_plus_b tensorflow.get_collection _fetch neuroner.utils.renamed_load numpy.copy entity.replace neuroner.neuromodel.NeuroNER.fit prediction_step configparser.ConfigParser.set trim_dataset_pickle matplotlib.pyplot.gca sklearn.preprocessing.normalize.flatten sklearn.metrics.f1_score tensorflow.train.Saver.restore matplotlib.pyplot.colorbar sklearn.preprocessing.LabelBinarizer.fit tensorflow.summary.merge_all pretraining_dataset.index_to_character.values trim_model_checkpoint self.character_indices_padded.update classification_report.split l.rstrip.replace.replace.replace.strip configparser.ConfigParser.read neuroner.utils_nlp.remove_bio_from_label_name dataset.token_to_index.keys neuroner.utils.reverse_dictionary os.path.dirname os.remove self._check_param_compatibility _clean_param_dtypes.update labels.copy show_values pc.get_facecolors self.label_vector_indices.update tensorflow.cast get_sentences_and_tokens_from_spacy random.choice neuroner.train.train_step operator.itemgetter parse_arguments.items tensorflow.get_variable dictionary.items self.prediction_count.str.zfill list sentence_tokens.append neuroner.evaluate.remap_labels int os.path.basename numpy.random.uniform tensorflow.contrib.tensorboard.plugins.projector.visualize_embeddings token.replace tensorflow.concat neuroner.utils_nlp.get_parsed_conll_output colors.append copy.copy pkg_resources.resource_filename classes.append neuroner.entity_lstm.EntityLSTM save_results tensorflow.train.GradientDescentOptimizer neuroner.utils_tf.resize_tensor_variable tensorflow.sqrt l.rstrip.replace.replace.replace classification_report.keys neuroner.neuromodel.NeuroNER infrequent_token_indices.append neuroner.utils_plots.plot_classification_report neuroner.utils_nlp.replace_unicode_whitespaces_with_ascii_whitespace dataset_type.label_vector_indices.append dataset_type.f1_dict_all.append epoch_number.str.zfill check_param_compatibility enumerate os.path.isdir new_label_sequence.append neuroner.utils.order_dictionary.get neuroner.utils.copytree neuroner.utils.order_dictionary super neuroner.brat_to_conll.brat_to_conll token.lower min tensorflow.nn.dropout class_names.append numpy.all argparse.ArgumentParser.parse_args str.lower self.label_indices.update embeddings_projector_config.embeddings.add collections.defaultdict.keys ax.xaxis.get_major_ticks sklearn.metrics.confusion_matrix conf_parameters.write spacy.load join input_filepath.xml.etree.ElementTree.parse.getroot.findall token.token.text.replace max self.modeldata.load_dataset spacy_nlp time.time tensorflow.train.AdadeltaOptimizer list.remove ax.pcolor.append load_parameters heatmap sklearn.preprocessing.LabelBinarizer.transform embedding_weights.assign tensorflow.ConfigProto self.token_indices.update self.sess.run cur_line.split.split matplotlib.use line.strip.replace.split matplotlib.pyplot.ylim tensorflow.train.Saver codecs.open.readline plot_f1_vs_epoch shutil.copy all self.unique_labels_of_interest.remove time.localtime cur_line.split.strip warnings.warn numpy.array re.sub tensorflow.variables_initializer f.read RenameUnpickler ValueError tensorflow.train.AdamOptimizer format set utils.create_folder_if_not_exists matplotlib.pyplot.gca.set_yticklabels random.randint neuroner.utils.get_current_time_in_miliseconds original_conll_file.readline.strip neuroner.utils.create_folder_if_not_exists pickle.dump collections.defaultdict neuroner.utils_nlp.convert_conll_from_bio_to_bioes self.__del__ sklearn.preprocessing.normalize string.split sklearn.preprocessing.LabelBinarizer glob.glob get_cmap pretraining_dataset.label_to_index.copy pycorenlp.StanfordCoreNLP.annotate main tensorflow.equal output_entities parse_arguments token_dict.replace tensorflow.placeholder input_filepath.xml.etree.ElementTree.parse.getroot.findtext float result.update AUC.flatten.min get_start_and_end_offset_of_token_from_spacy self.unique_labels.append model.saver.save matplotlib.pyplot.legend writers.get_logdir f1.np.asarray.argmax dataset.__dict__.keys pc.get_paths l.rstrip.replace set.add dataset_type.result_update.update remap_labels abs index_to_string.items entities.append check_bio_bioes_compatibility tensorflow.nn.softmax_cross_entropy_with_logits line.strip.split.append tuple matplotlib.pyplot.gca.set_xticks output_filepaths.keys AUC.flatten.max self.RenameUnpickler.super.find_class xml.etree.ElementTree.parse sklearn.metrics.accuracy_score self._convert_to_indices numpy.asarray line.split.split self.token_lengths.update f.read.splitlines matplotlib.pyplot.axhline tensorflow.shape codecs.open.close l.rstrip dict bioes_to_bio matplotlib.pyplot.gca.pcolor warnings.filterwarnings neuroner.conll_to_brat.check_compatibility_between_conll_and_brat_text json.loads zip matplotlib.pyplot.close shutil.copy2 self.sess.as_default neuroner.utils_tf.variable_summaries line.strip.split self.optimizer.apply_gradients neuroner.conll_to_brat.output_entities ax.xaxis.tick_top tensorflow.contrib.crf.crf_log_likelihood sklearn.metrics.precision_recall_fscore_support matplotlib.pyplot.savefig configparser.ConfigParser setuptools.setup results.keys tensorflow.squeeze
@developer
Could please help me check this issue?
May I pull a request to fix it?
Thank you very much.