demo

demo / spacydemo / 1.0.0

README.md

Overview

A simple demo algorithm showing how to load dependencies necessary to use the SpaCy library's pre-trained models. This example uses the entity recognition model as is take directly from the SpaCy docs.

Usage

Input

Takes a string of text. Should be several sentences long to pull entities out of it such as Person, Date, Org, etc.

ParameterDescription
StringMultiple sentences as one string

Output

Output parsed to JSON array with objects containing the text that has been tokenized along with the associated label of the entity.

ParameterDescription
arrayArray of key value pairs

Examples

Input:

"When Sebastian Thrun started working on self-driving cars at Google in 2007, few people outside of the company took him seriously. I can tell you very senior CEOs of major American car companies would shake my hand and turn away because I wasn’t worth talking to, said Thrun, now the co-founder and CEO of online higher education startup Udacity, in an interview with Recode earlier this week."

Output:

[
	{'entity': 'PERSON', 'text': 'Sebastian Thrun'},
	{'entity': 'ORG', 'text': 'Google'},
	{'entity': 'DATE', 'text': '2007'},
	{'entity': 'NORP', 'text': 'American'},
	{'entity': 'PERSON', 'text': 'Thrun'},
	{'entity': 'ORG', 'text': 'Recode'},
	{'entity': 'DATE', 'text': 'earlier this week'}
]