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

'io.anserini.search.ScoredDoc' object has no attribute 'raw' #1773

Open
nactran opened this issue Jan 18, 2024 · 2 comments
Open

'io.anserini.search.ScoredDoc' object has no attribute 'raw' #1773

nactran opened this issue Jan 18, 2024 · 2 comments

Comments

@nactran
Copy link

nactran commented Jan 18, 2024

I tried to follow the tutorial at https://github.com/castorini/pyserini/blob/master/docs/usage-search.md, but when I run the statement

hits[0].raw,

the system prompts
AttributeError: 'io.anserini.search.ScoredDoc' object has no attribute 'raw'.

I am using the index msmarco-v1-passage, which should have included the raw text. Does anyone know the reason?

@lintool
Copy link
Member

lintool commented Jan 18, 2024

Hi @nactran - see #1762 (comment) - although the documentation does need to be updated.

If you can send a PR to fix, that'd be greatly appreciated.

@cstk2715
Copy link

try this ,it can work

hits[0].lucene_document.get('raw')

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

3 participants