spert icon indicating copy to clipboard operation
spert copied to clipboard

TypeError: 'NoneType' object is not callable

Open Deerzh opened this issue 1 year ago • 1 comments

Hi, when I have run this command: python ./spert.py predict --config configs/example_predict.conf, an error occurred,like this:Traceback (most recent call last): File "/home/zhang/anaconda3/envs/spert/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/home/zhang/anaconda3/envs/spert/lib/python3.7/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/home/zhang/compatibility_analysis/spert/spert.py", line 39, in __predict input_reader_cls=input_reader.JsonPredictionInputReader) File "/home/zhang/compatibility_analysis/spert/spert/spert_trainer.py", line 143, in predict dataset = input_reader.read(dataset_path, 'dataset') File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 201, in read self._parse_dataset(dataset_path, dataset) File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 208, in _parse_dataset self._parse_document(document, dataset) File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 216, in _parse_document jtokens = [t.text for t in self._nlp(document)] TypeError: 'NoneType' object is not callable

And then, I checked configs/example_predict.conf, I found this sentence: predictions_path = data/predictions.json. But in data route, predictions.json doesn't exist. Can you help me fixed this problem?

Deerzh avatar Aug 09 '22 07:08 Deerzh

Hi, when I have run this command: python ./spert.py predict --config configs/example_predict.conf, an error occurred,like this:Traceback (most recent call last): File "/home/zhang/anaconda3/envs/spert/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/home/zhang/anaconda3/envs/spert/lib/python3.7/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/home/zhang/compatibility_analysis/spert/spert.py", line 39, in __predict input_reader_cls=input_reader.JsonPredictionInputReader) File "/home/zhang/compatibility_analysis/spert/spert/spert_trainer.py", line 143, in predict dataset = input_reader.read(dataset_path, 'dataset') File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 201, in read self._parse_dataset(dataset_path, dataset) File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 208, in _parse_dataset self._parse_document(document, dataset) File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 216, in _parse_document jtokens = [t.text for t in self._nlp(document)] TypeError: 'NoneType' object is not callable

And then, I checked configs/example_predict.conf, I found this sentence: predictions_path = data/predictions.json. But in data route, predictions.json doesn't exist. Can you help me fixed this problem?

I meet the same problem, I found the reason is that you foget pip install spacy!

yy2lyx avatar Oct 09 '22 02:10 yy2lyx