Skip to main content

No project description provided

Project description

Example workflow

Load ontology

via github link or local directory

import ontopics as ot
onthology = ot.load_onthology("https://github.com/OpenCS-ontology/OpenCS")

# or 

onthology = ot.load_onthology("onthologies/OpenCS", objects = "", descriptions = "")

Prepare topics for classification

# topics is a 
topics = onthology.prepare_topics()

Classify text to ontologies

from ontopic.models import TopicalClassifier

text = "In this paper we introduce novel NLP NER machine learning model"
model = TopicalClassifier()

# to get top 10 topics, 5 is by default
topics = model.predict(text, top=10)

# to get topics which are above given threshold of 'probability'
topics = model.predict(text, threshold=0.2)

# to get topics and also probabilities
topics, proba = model.predict(text, proba=True)

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

ontopic-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

ontopic-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file ontopic-0.1.0.tar.gz.

File metadata

  • Download URL: ontopic-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.6 Windows/10

File hashes

Hashes for ontopic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c47e4db101d59b4084c7809c64750ad6727aa50f155c016e3aa39f13079ff8d0
MD5 2b07ba7556acba455d1304e71522031a
BLAKE2b-256 c981d254250af0adfd3d3380ea371149320bb477d0a7c7a95c6f52c89139e172

See more details on using hashes here.

File details

Details for the file ontopic-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ontopic-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.6 Windows/10

File hashes

Hashes for ontopic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9148f8eed52a2075f91d3ef8b756413e4e2c67c7c0b2eaba319949b40ee59b2c
MD5 1bc0f38c82e1f036ca84446d7ecb44bd
BLAKE2b-256 df8c2c0ea7e3d3c1faf4fb71a540e31296ae5b21c6da94f72b5c85d71e859a31

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