jina-ai/examples

AttributeError in Wikipedia Sentences Example

karndeb opened this issue · 2 comments

While testing the wikipedia sentences example, I am getting Attribute Error for score in the indexer.py file at line 29 which is d.score.value = 1 - _dist .

The Traceback:-

jina

Jina version is 2.0.5

Please help

The example code is not updated to the latest document api, the right attribute now is scores, which is a key value pair.
e.g. you need to do d.scores['cosine'] = 1 - _dist as documented in https://github.com/jina-ai/jina/blob/master/.github/2.0/cookbooks/Document.md#add-relevancy-to-documents

@Kelton8Z Thanks. Closing the issue