Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'NoneType' object is not callable #66

Open
Deerzh opened this issue Aug 9, 2022 · 1 comment
Open

TypeError: 'NoneType' object is not callable #66

Deerzh opened this issue Aug 9, 2022 · 1 comment

Comments

@Deerzh
Copy link

Deerzh commented Aug 9, 2022

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?

@yy2lyx
Copy link

yy2lyx commented Oct 9, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants