Skip to main content

A Python client for Sherlok

Project description

Sherlok is a flexible and powerful open source, distributed, real-time text-mining engine.

pip install --upgrade sherlok

from sherlok import Sherlok

s = Sherlok('neuroner')

# returns a list of tuples (begin, end, text, annotation_type, attributes{})
print s.annotate('layer 4 neuron')

[(0, 14, 'layer 4 neuron', u'Neuron', {}),
 (8, 14, 'neuron',  u'Neuron', {}),
 (8, 14, 'neuron',  u'NeuronTrigger', {}),
 (0, 7,  'layer 4', u'Layer', {u'ontologyId': u'HBP_LAYER:0000004'})]


# filtering and finding the text back
txt = 'parvalbumin-positive fast-spiking basket cells, somatostatin-positive regular-spiking bipolar and multipolar cells, and cholecystokinin-positive irregular-spiking bipolar and multipolar cells'
morphology = s.annotate(txt, u'Morphology')
for (start, end, text, _type, properties) in morphology:
    print text, properties[u'ontologyId']

basket HBP_MORPHOLOGY:0000019
bipolar HBP_MORPHOLOGY:0000006
multipolar HBP_MORPHOLOGY:0000035
bipolar HBP_MORPHOLOGY:0000006
multipolar HBP_MORPHOLOGY:0000035

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

sherlok-0.1.6.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file sherlok-0.1.6.tar.gz.

File metadata

  • Download URL: sherlok-0.1.6.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sherlok-0.1.6.tar.gz
Algorithm Hash digest
SHA256 6f11805d5b9cac9c6cee06661859908f187964f30c216ac3928eef4dc56b07dc
MD5 761705aa9dafd4a1041a48c09f776856
BLAKE2b-256 37b336b0d32264d54edb67c0a1c34068671e963a7671ece558941f774e7c4912

See more details on using hashes here.

Supported by

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