Franck-Dernoncourt / NeuroNER

Named-entity recognition using neural networks. Easy-to-use and state-of-the-art results.
http://neuroner.com
MIT License
1.7k stars 475 forks source link

Always Getting "0.00" in precision & recall while data processing #167

Closed ashikrafi closed 4 years ago

ashikrafi commented 4 years ago

Hi @Franck-Dernoncourt and @kaushikacharya

Thank you very much for your cooperation. You guys have done tremendous jobs. Anyway, I am having problems regarding some issues.

- Why am I getting "0.00" in precision & recall while data processing?

Below I have shared the screenshots. Could you please help me out? S.N. Please skip the line TEST PURPOSE-e in the screenshots. I used it while debugging.

Screenshots:

Configuration:

{'character_embedding_dimension': 25, 'character_lstm_hidden_state_dimension': 25, 'check_for_digits_replaced_with_zeros': 1, 'check_for_lowercase': 1, 'dataset_text_folder': './data/conll2003/en/', 'debug': 1, 'dropout_rate': 0.5, 'experiment_name': 'experiment', 'fetch_data': '', 'fetch_trained_model': '', 'freeze_token_embeddings': 0, 'gradient_clipping_value': 5.0, 'learning_rate': 0.005, 'load_all_pretrained_token_embeddings': 0, 'load_only_pretrained_token_embeddings': 0, 'main_evaluation_mode': 'conll', 'maximum_number_of_epochs': 10, 'number_of_cpu_threads': 8, 'number_of_gpus': 6, 'optimizer': 'sgd', 'output_folder': './output', 'output_scores': 0, 'parameters_filepath': '.\parameters.ini', 'patience': 10, 'plot_format': 'pdf', 'pretrained_model_folder': './trained_models/i2b2_2014_deid', 'reload_character_embeddings': 1, 'reload_character_lstm': 1, 'reload_crf': 1, 'reload_feedforward': 1, 'reload_token_embeddings': 1, 'reload_token_lstm': 1, 'remap_unknown_tokens_to_unk': 1, 'spacylanguage': 'en', 'tagging_format': 'bioes', 'token_embedding_dimension': 100, 'token_lstm_hidden_state_dimension': 100, 'token_pretrained_embedding_filepath': './data/word_vectors/glove.6B.100d.txt', 'tokenizer': 'spacy', 'train_model': 1, 'use_character_lstm': 1, 'use_crf': 1, 'use_pretrained_model': 0, 'verbose': 0}

Thank you for taking the time. I look forward to hearing from you.

Regards, @ashikrafi

ashikrafi commented 4 years ago

Hi @Franck-Dernoncourt @kaushikacharya

Hope you are doing well. I look forward to hearing from you soon.

ashikrafi commented 4 years ago

Hi All,

Problem solved. Thanks Much.

Franck-Dernoncourt commented 4 years ago

Great to great! What was the issue?

On Thu, Jun 11, 2020, 01:04 Md Ashikur Rahman notifications@github.com wrote:

Closed #167 https://github.com/Franck-Dernoncourt/NeuroNER/issues/167.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Franck-Dernoncourt/NeuroNER/issues/167#event-3432970631, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADXYYA3NABLAIBJ7Q5HJLRWCFYBANCNFSM4N2IHXOQ .

kaushikacharya commented 4 years ago

@ashikrafi

  1. It seems ORG class doesn't have a single instance in your train set.
  2. Though its a different library(scikit-learn), but the warning mentioned here might be relevant in your case:

https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/metrics/_classification.py#L1208

    # build appropriate warning
    # E.g. "Precision and F-score are ill-defined and being set to 0.0 in
    # labels with no predicted samples. Use ``zero_division`` parameter to
    # control this behavior."