cdqa-suite / cdQA

⛔ [NOT MAINTAINED] An End-To-End Closed Domain Question Answering System.
https://cdqa-suite.github.io/cdQA-website/
Apache License 2.0
614 stars 191 forks source link

I get Attribute error when try the example code in my system during prediction step. Though it works fine in colab #291

Closed ARArun closed 4 years ago

ARArun commented 4 years ago

query = 'Since when does the Excellence Program of BNP Paribas exist?' prediction = cdqa_pipeline.predict(query) query = 'Since when does the Excellence Program of BNP Paribas exist?' prediction = cdqa_pipeline.predict(query)

RemoteTraceback Traceback (most recent call last) RemoteTraceback: """ Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py", line 119, in worker result = (True, func(*args, *kwds)) File "C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py", line 44, in mapstar return list(map(args)) File "\localhost\c$\myfiles\new_cdqa\cdqa-master\cdqa\reader\bertqa_sklearn.py", line 326, in _example_to_features_parallel query_tokens = tokenizer.tokenize(example.question_text) AttributeError: 'NoneType' object has no attribute 'tokenize' """

The above exception was the direct cause of the following exception:

AttributeError Traceback (most recent call last)

in () 1 query = 'Since when does the Excellence Program of BNP Paribas exist?' ----> 2 prediction = cdqa_pipeline.predict(query) \\localhost\c$\myfiles\new_cdqa\cdqa-master\cdqa\pipeline\cdqa_sklearn.py in predict(self, query, n_predictions, retriever_score_weight, return_all_preds) 182 retrieve_by_doc=self.retrieve_by_doc, 183 ) --> 184 examples, features = self.processor_predict.fit_transform(X=squad_examples) 185 prediction = self.reader.predict( 186 X=(examples, features), C:\ProgramData\Anaconda3\lib\site-packages\sklearn\base.py in fit_transform(self, X, y, **fit_params) 515 if y is None: 516 # fit method of arity 1 (unsupervised transformation) --> 517 return self.fit(X, **fit_params).transform(X) 518 else: 519 # fit method of arity 2 (supervised transformation) \\localhost\c$\myfiles\new_cdqa\cdqa-master\cdqa\reader\bertqa_sklearn.py in transform(self, X) 1054 is_training=self.is_training, 1055 verbose=self.verbose, -> 1056 n_jobs=self.n_jobs, 1057 ) 1058 \\localhost\c$\myfiles\new_cdqa\cdqa-master\cdqa\reader\bertqa_sklearn.py in convert_examples_to_features(examples, tokenizer, max_seq_length, doc_stride, max_query_length, is_training, verbose, n_jobs) 292 verbose, 293 ) --> 294 for (example_index, example) in enumerate(examples) 295 ], 296 ) C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py in map(self, func, iterable, chunksize) 264 in a list that is returned. 265 ''' --> 266 return self._map_async(func, iterable, mapstar, chunksize).get() 267 268 def starmap(self, func, iterable, chunksize=None): C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py in get(self, timeout) 642 return self._value 643 else: --> 644 raise self._value 645 646 def _set(self, i, obj): AttributeError: 'NoneType' object has no attribute 'tokenize'
ARArun commented 4 years ago

In the .fit_retriever part I got the following warnings

Model name 'bert-base-uncased' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese). We assumed 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt' was a path or url but couldn't find any file associated to this path or url. Model name 'bert-base-uncased' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese). We assumed 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt' was a path or url but couldn't find any file associated to this path or url.