Skip to main content

Semantically is a Python library designed to easily retrieve data from Semantic Scholar.

Project description

semantically

Introduction

Semantically is a Python library designed to easily retrieve data from Semantic Scholar. All data is typed in dataclasses built around the Semantic Scholar API. Furthermore semantically supports methods to retrieve papers by their title in order. For larger requests semantically offers methods to retrieve papers according to lists of keywords. In the background these requests are run asynchronously so that several requests can be sent in a short amount of time.

Requirements

Python 3.6+

Semantically relies mainly on

  • Levenshtein
  • dacite
  • aiohttp

Installation

Semantically can be installed via pip with

pip install semantically

Examples

Using semantically to retrieve paper information is as easy as

import semantically

semantic_scholar = semantically.Semantically()
paper_info = semantic_scholar.get_paper_by_title(
    "Supporting the Exploration of Semantic Features in Academic Literature using Graph-based Visualizations"
)

print(paper_info) # Paper(paperId='175ac9646f3a7b6491c6bad896c47c495633d54a', externalIds={'MAG': '3046741163', 'DBLP': 'conf/jcdl/BreitingerKMMG20', ...

Getting an author by name:

import semantically

semantic_scholar = semantically.Semantically()
author_info = semantic_scholar.get_author_by_name("Albert Einstein")

print(author_info[0])  # DetailedAuthor(authorId='2059041927', externalIds={}, url='https://www.semanticscholar.org/author/2059041927',...

This example queries the API for 7 keywords, each containing 10 results:

import semantically

keywords = ["Recommender System", "Blockchain", "Natural Language Processing", "Plagiarism Detection", "News Analysis", "Information Retrieval", "Machine Learning"]

semantic_scholar = semantically.Semantically()
paper_info = semantic_scholar.get_papers_by_keyword(keywords, limit=10)

print(paper_info["Natural Language Processing"][4]) # Paper(paperId='084c55d6432265785e3ff86a2e900a49d501c00a', externalIds=None, url=None, title='Foundations of statistical natural language processing'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semantically-0.2.2.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

semantically-0.2.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file semantically-0.2.2.tar.gz.

File metadata

  • Download URL: semantically-0.2.2.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.4

File hashes

Hashes for semantically-0.2.2.tar.gz
Algorithm Hash digest
SHA256 7c043705019d32f0d0c18cade12b9eedb60fa56105acb6adc30278b7df95ceb1
MD5 16d40b43e77cc4789aeca7bab1f05fbc
BLAKE2b-256 84342ab3d0d6bcd72e44b35f3f0866b4145f979f2a52f3925b069417f39a8f45

See more details on using hashes here.

File details

Details for the file semantically-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: semantically-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.4

File hashes

Hashes for semantically-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8823ddc76c31882ffed7d984bfbf4b638d4324927af79c6fc96522881c48f0ee
MD5 3549e8982b6f9b51da2f3272a609187a
BLAKE2b-256 54faf11a71103493238a1a16660d154f00d99e66739f868190907aaca9b88722

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page