-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get details about a paper's references
- Loading branch information
1 parent
2d24ca2
commit 6b4f2c7
Showing
7 changed files
with
1,261 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from semanticscholar.Paper import Paper | ||
from semanticscholar.SemanticScholarObject import SemanticScholarObject | ||
|
||
|
||
class BaseReference(SemanticScholarObject): | ||
''' | ||
Base class for both Citation and Reference classes. | ||
''' | ||
|
||
FIELDS = [ | ||
'contexts', | ||
'intents', | ||
'isInfluential' | ||
] | ||
|
||
def __init__(self, data: dict) -> None: | ||
super().__init__() | ||
self._contexts = None | ||
self._intents = None | ||
self._isInfluential = None | ||
self._paper = None | ||
self._init_attributes(data) | ||
|
||
@property | ||
def contexts(self) -> list: | ||
''' | ||
:type: :class:`list` | ||
''' | ||
return self._contexts | ||
|
||
@property | ||
def intents(self) -> list: | ||
''' | ||
:type: :class:`list` | ||
''' | ||
return self._intents | ||
|
||
@property | ||
def isInfluential(self) -> bool: | ||
''' | ||
:type: :class:`bool` | ||
''' | ||
return self._isInfluential | ||
|
||
@property | ||
def paper(self) -> Paper: | ||
''' | ||
:type: :class:`semanticscholar.Paper.Paper` | ||
''' | ||
return self._paper | ||
|
||
def _init_attributes(self, data: dict) -> None: | ||
self._data = data | ||
if 'contexts' in data: | ||
self._contexts = data['contexts'] | ||
if 'intents' in data: | ||
self._intents = data['intents'] | ||
if 'isInfluential' in data: | ||
self._isInfluential = data['isInfluential'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from semanticscholar.Paper import Paper | ||
from semanticscholar.BaseReference import BaseReference | ||
|
||
|
||
class Reference(BaseReference): | ||
''' | ||
This class abstracts a reference. | ||
''' | ||
|
||
def __init__(self, data: dict) -> None: | ||
super().__init__(data) | ||
if 'citedPaper' in data: | ||
self._paper = Paper(data['citedPaper']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"contexts": ["Other VAElike approaches exist [12, 22] but are less closely related to our method."], "intents": ["result"], "isInfluential": false, "citedPaper": {"paperId": "018300f5f0e679cee5241d9c69c8d88e00e8bf31", "externalIds": {"MAG": "2122262818", "ArXiv": "1402.0030", "DBLP": "conf/icml/MnihG14", "CorpusId": 1981188}, "corpusId": 1981188, "publicationVenue": {"id": "fc0a208c-acb7-47dc-a0d4-af8190e21d29", "name": "International Conference on Machine Learning", "type": "conference", "alternate_names": ["ICML", "Int Conf Mach Learn"], "url": "https://icml.cc/"}, "url": "https://www.semanticscholar.org/paper/018300f5f0e679cee5241d9c69c8d88e00e8bf31", "title": "Neural Variational Inference and Learning in Belief Networks", "abstract": "Highly expressive directed latent variable models, such as sigmoid belief networks, are difficult to train on large datasets because exact inference in them is intractable and none of the approximate inference methods that have been applied to them scale well. We propose a fast non-iterative approximate inference method that uses a feedforward network to implement efficient exact sampling from the variational posterior. The model and this inference network are trained jointly by maximizing a variational lower bound on the log-likelihood. Although the naive estimator of the inference network gradient is too high-variance to be useful, we make it practical by applying several straightforward model-independent variance reduction techniques. Applying our approach to training sigmoid belief networks and deep autoregressive networks, we show that it outperforms the wake-sleep algorithm on MNIST and achieves state-of-the-art results on the Reuters RCV1 document dataset.", "venue": "International Conference on Machine Learning", "year": 2014, "referenceCount": 34, "citationCount": 662, "influentialCitationCount": 89, "isOpenAccess": false, "openAccessPdf": null, "fieldsOfStudy": ["Computer Science", "Mathematics"], "s2FieldsOfStudy": [{"category": "Computer Science", "source": "external"}, {"category": "Mathematics", "source": "external"}, {"category": "Computer Science", "source": "s2-fos-model"}], "publicationTypes": ["JournalArticle", "Conference"], "publicationDate": "2014-01-31", "journal": {"volume": "abs/1402.0030", "name": "ArXiv"}, "authors": [{"authorId": "1714004", "name": "A. Mnih"}, {"authorId": "144717963", "name": "Karol Gregor"}]}} |
Oops, something went wrong.