Skip to main content

Use spaCy to Parse Input Tokens

Project description

spaCy Token Parser (spacy-token-parser)

Use spaCy to Parse Input Tokens

Usage

Call the service with this code

from spacy_token_parser import parse_tokens

parse_tokens(input_text.split())

The output is a tuple.

The first element of the tuple is a list of dictionary tokens (below).

The second element of the tuple is a wrapped instance of spacy.tokens.doc.Doc.

List Output

[
   {
      "dep":"compound",
      "ent":"NORP",
      "head":"5665575797947403677",
      "id":"6042939320535660714",
      "is_alpha":true,
      "is_punct":false,
      "is_stop":false,
      "is_wordnet":true,
      "lemma":"american",
      "noun_number":"singular",
      "other":{
         "head_i":3,
         "head_idx":24,
         "head_orth":5665575797947403677,
         "head_text":"films",
         "i":0,
         "idx":0,
         "orth":6042939320535660714
      },
      "pos":"PROPN",
      "sentiment":0.0,
      "shape":"xxxx",
      "tag":"NNP",
      "tense":"",
      "text":"american",
      "verb_form":"",
      "x":0,
      "y":8
   },
   {
      "dep":"compound",
      "ent":"",
      "head":"5665575797947403677",
      "id":"16602643206033239142",
      "is_alpha":true,
      "is_punct":false,
      "is_stop":false,
      "is_wordnet":true,
      "lemma":"silent",
      "noun_number":"singular",
      "other":{
         "head_i":3,
         "head_idx":24,
         "head_orth":5665575797947403677,
         "head_text":"films",
         "i":1,
         "idx":9,
         "orth":16602643206033239142
      },
      "pos":"PROPN",
      "sentiment":0.0,
      "shape":"xxxx",
      "tag":"NNP",
      "tense":"",
      "text":"silent",
      "verb_form":"",
      "x":8,
      "y":14
   },
   {
      "dep":"compound",
      "ent":"",
      "head":"5665575797947403677",
      "id":"16417888112635110788",
      "is_alpha":true,
      "is_punct":false,
      "is_stop":false,
      "is_wordnet":true,
      "lemma":"feature",
      "noun_number":"singular",
      "other":{
         "head_i":3,
         "head_idx":24,
         "head_orth":5665575797947403677,
         "head_text":"films",
         "i":2,
         "idx":16,
         "orth":16417888112635110788
      },
      "pos":"NOUN",
      "sentiment":0.0,
      "shape":"xxxx",
      "tag":"NN",
      "tense":"",
      "text":"feature",
      "verb_form":"",
      "x":14,
      "y":21
   },
   {
      "dep":"ROOT",
      "ent":"",
      "head":"5665575797947403677",
      "id":"5665575797947403677",
      "is_alpha":true,
      "is_punct":false,
      "is_stop":false,
      "is_wordnet":true,
      "lemma":"film",
      "noun_number":"plural",
      "other":{
         "head_i":3,
         "head_idx":24,
         "head_orth":5665575797947403677,
         "head_text":"films",
         "i":3,
         "idx":24,
         "orth":5665575797947403677
      },
      "pos":"NOUN",
      "sentiment":0.0,
      "shape":"xxxx",
      "tag":"NNS",
      "tense":"",
      "text":"films",
      "verb_form":"",
      "x":21,
      "y":26
   }
]

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

spacy-token-parser-0.1.13.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

spacy_token_parser-0.1.13-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file spacy-token-parser-0.1.13.tar.gz.

File metadata

  • Download URL: spacy-token-parser-0.1.13.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.5 Windows/10

File hashes

Hashes for spacy-token-parser-0.1.13.tar.gz
Algorithm Hash digest
SHA256 db3ab6ca76563100ea8ede905f0d9e6647573b687c28fe2077c0f57209b2ae40
MD5 2ee98a359d63367739d20e1c02e313a7
BLAKE2b-256 c978553ee6ce72ed6a3d72b5fd0db6b3e4ff0cb4e596460554cda69d1490d34a

See more details on using hashes here.

File details

Details for the file spacy_token_parser-0.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for spacy_token_parser-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 0e471f23d67b6d44670ad19e3cdcd1138dfc3b138836194fdf34346566a57e59
MD5 497835dceee01040e2dedd4c234a6698
BLAKE2b-256 c9e5b72c34f7ee0c1b8a7940d1911e14c4a9369c9533e302e29be2cdb0e91102

See more details on using hashes here.

Supported by

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