NeuroNER icon indicating copy to clipboard operation
NeuroNER copied to clipboard

Weight sum to zero, can't be normalized

Open rriveraz opened this issue 6 years ago • 1 comments

Hi Frank.

Im trying to train a new model using spacy in spanish, spanish dataset and a pre trained spanish model, but when i start NeuroNER it works fine until the plot generation. Can you help me with this problem.

Evaluate model on the valid set processed 11796 tokens with 168 phrases; found: 6206 phrases; correct: 28. accuracy: 43.51%; precision: 0.45%; recall: 16.67%; FB1: 0.88 Discapacity: precision: 0.45%; recall: 16.67%; FB1: 0.88 6206

Generating plots for the train set Traceback (most recent call last): File "main.py", line 250, in main() File "main.py", line 246, in main nn.fit() File "/home/users/rmrivera/NeuroNER-master/src/neuroner.py", line 394, in fit evaluate.evaluate_model(results, dataset, y_pred, y_true, stats_graph_folder, epoch_number, epoch_start_time, output_filepaths, parameters) File "/home/users/rmrivera/NeuroNER-master/src/evaluate.py", line 239, in evaluate_model verbose=verbose) File "/home/users/rmrivera/NeuroNER-master/src/evaluate.py", line 17, in assess_model classification_report = sklearn.metrics.classification_report(y_true, y_pred, labels=labels, target_names=target_names, sample_weight=None, digits=4) File "/usr/local/lib/python3.5/dist-packages/sklearn/metrics/classification.py", line 1457, in classification_report np.average(p, weights=s), File "/usr/local/lib/python3.5/dist-packages/numpy/lib/function_base.py", line 1158, in average "Weights sum to zero, can't be normalized") ZeroDivisionError: Weights sum to zero, can't be normalized

rriveraz avatar Apr 07 '18 20:04 rriveraz

Hello,

I recently ran into this problem myself. The reason to why I got it was that either my Train, Valid or Test set did not have any correct .ann-file (with the "true" annotations). Double check that all files have an .ann file (that isn't empty) for your Train, Valid and Test set.

JustusJL avatar Apr 25 '18 07:04 JustusJL