Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Added Semantic scholar reader #439

Merged
merged 19 commits into from
Aug 3, 2023

Conversation

shauryr
Copy link
Contributor

@shauryr shauryr commented Aug 2, 2023

This module loads papers from semantic scholar search for which the user can question and get answers to. It is using the semanticscholar library to search and get results.

The user can define a broader search space, get the Documents loaded in llama_index and then ask questions as demoed here -

image

@jerryjliu
Copy link
Collaborator

this is awesome! will review soon

ServiceContext,
)

s2reader = download_loader('SemanticScholarReader')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you never import download_loader from llama_index

also recommended way now is from llama_hub.semantic_scholar.base import SemanticScholarReader (e.g. import as package)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh thanks for pointing that out. I have included it here 20819ea

@shauryr shauryr requested a review from jerryjliu August 3, 2023 13:50
import logging
from llama_index.readers.base import BaseReader
from llama_index.readers.schema.base import Document
from semanticscholar import SemanticScholar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you do the import from the class constructor or methods? The reason is that we want this to be lazily imported.

Take a look at other loader implementations as example!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for this suggestion! I have moved it here 977671c

@shauryr shauryr requested a review from Disiok August 3, 2023 15:27
@jerryjliu jerryjliu merged commit c0983d4 into run-llama:main Aug 3, 2023
2 checks passed
@shauryr shauryr deleted the semantic-scholar-reader branch August 4, 2023 03:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants