Parsey McParseface

No algorithm description given

Note: Now introducing Parsey's Cousins! We've added many new languages to parsey, and revitalized our output formats! Table of Contents Introduction I/O Examples Languages credits Algorithm Console Introduction Parsey McParseface is a language parsing tool that is fantastic at tagging word meanings within sentences and forming a parse tree (in Tree or Conll  or Graph format) for other NLP algorithms to use. I/O Input { 
"src": String,
"format": String,
"language": String
}
 src - (required) - The source text to parse, sentences should end with either a ! , ? or . and will be parsed as separate sentences in the output. format - (optional) - The output format of the parse, can be either tree , graph or conll , defaults to tree . language - (optional) - The language of the text you wish to parse, this selects the particular parsey model for that language, defaults to English . Outputs These output formats are defined by the format flag. conll tree graph Conll Format This is the Conll-U style of output, more info about Conll-U can be found here . The conll output is parsed to JSON and is in the following format: {
 "output": {
 "sentences": [
 {
 "words": [
 {
 "lemma": String,
 "head": Int,
 "features": {...},
 "universal_pos": String,
 "extra_deps": [...],
 "language_pos": String,
 "misc": String,
 "dep_relation": String,
 "form": String,
 "index": Int
 }
 ]
 }
 ]
 }
}

 output - A wrapper object around the main json body sentences - This is a json array of each sentence passed in as an input, each sentence has a single variable, "words". words - This is a json array of each word in a sentence, conll is word based so this is the main structure of the parse. form - The specific word or punctuation symbol. index - The position in which this word or punctuation symbol is in the sentence. lemma - If the language model uses base words, then this refers to the lemma. head - The "root" of this word in relation to the total sentence itself, see root , if 0 then this word is the sentence root. features - List of morphological features from the universal feature inventory or from a defined language-specific extension ; empty string if unavailble. universal_pos - This words  universal part of speech tag. language_pos - This words language specific part of speech tag, empty string if unavailable. extra_deps - if supported by the language model, is a list of secondary dependencies (head-deprel pairs). dep_relation - This words  Universal Stanford dependency relation to the HEAD (root iff HEAD = 0) or a defined language-specific subtype of one. misc - Any other annotation. Graph Format This format is a directed graph abstraction of the Conll format, utilizing the Json Graph Specification : {
 "output": {
 "sentences": [
 {
 "nodes": [
 {
 "lemma": String,
 "features": {..},
 "universal_pos": String,
 "language_pos": String,
 "id": Int,
 "misc": String,
 "form": String
 },
 ],
 "edges": [
 {"target": Int,"source": Int,"relationship": String},
 ]
 }
 ]
 }
}
 output - a wrapper object around the main json body sentences - This is a json array of each sentence passed in as an input, each sentence has two variable arrays, nodes and edges. nodes - a list of word verticies. edges - a list of part of speech edges, denotes word token relationships. nodes form - The specific word or punctuation symbol. id - the position in which this word or punctuation symbol is in the sentence, and also the vertex ID. lemma - If the language model uses base words, then this refers to the lemma. features - List of morphological features from the universal feature inventory or from a defined language-specific extension ; empty string if unavailble. universal_pos - refers to this word's universal part of speech tag. language_pos - refers to this words language specific part of speech tag, empty string if unavailable. misc - any other annotation. edges source - outgoing vertex id, equivalent to the "head" in the conll format. target - the incomming vertex id, equivalent to the "index" in the conll format. relationship - the specific dependency relationship between the source vertex and the target. Tree Format This output format comes directly from parsey as a string object, it's not parsable as json however it's compact nature makes is much easier to read: Input: Bob brought the pizza to Alice .
Parse:
brought VBD ROOT
 +-- Bob NNP nsubj
 +-- pizza NN dobj
 | +-- the DT det
 +-- to IN prep
 | +-- Alice NNP pobj
 +-- . . punct
 How to read The sentence Bob brought the pizza to Alice. is parsed as such: tThe syntatic root word of the sentence is brought , meaning it forms the structure. brought grammatically a passed tense verb . The first branch from brought is Bob , Bob is a proper noun and syntatically is a nominal subject . The second branch from brought is pizza , which is a singular noun and syntatically is a direct object , it creates the phrase the pizza . The only branch from pizza is the , which is a diet and a determiner . The third and final branch from brought is to , which is a preprosition , it creates the preprositional phrase to Alice The only branch from to is Alice , which is a proper noun like Bob , however syntatically it is a appositional modifier Examples Tree Example - English {"src":"Bob brought the pizza to Alice.", "format":"tree", "language":"English"}
 Input: Bob brought the pizza to Alice .
 Parse:
 brought VBD ROOT
 +-- Bob NNP nsubj
 +-- pizza NN dobj
 | +-- the DT det
 +-- to IN prep
 | +-- Alice NNP pobj
 +-- . . punct
 Graph Example - German {"src":"Bob brachte die Pizza zu Alice.", "format":"graph", "language":"german"}
 {
 "output": {
 "sentences": [
 {
 "nodes": [
 {
 "lemma": "",
 "features": {"fPOS": "PROPN++"},
 "universal_pos": "PROPN",
 "language_pos": "",
 "id": 1,
 "misc": "",
 "form": "Bob"
 },
 {
 "lemma": "",
 "features": {"fPOS": "VERB++"},
 "universal_pos": "VERB",
 "language_pos": "",
 "id": 2,
 "misc": "",
 "form": "brachte"
 },
 {
 "lemma": "",
 "features": {"fPOS": "DET++"},
 "universal_pos": "DET",
 "language_pos": "",
 "id": 3,
 "misc": "",
 "form": "die"
 },
 {
 "lemma": "",
 "features": {"fPOS": "NOUN++"},
 "universal_pos": "NOUN",
 "language_pos": "",
 "id": 4,
 "misc": "",
 "form": "Pizza"
 },
 {
 "lemma": "",
 "features": {"fPOS": "ADP++"},
 "universal_pos": "ADP",
 "language_pos": "",
 "id": 5,
 "misc": "",
 "form": "zu"
 },
 {
 "lemma": "",
 "features": {"fPOS": "PROPN++"},
 "universal_pos": "PROPN",
 "language_pos": "",
 "id": 6,
 "misc": "",
 "form": "Alice."
 }
 ],
 "edges": [
 {"target": 1,"source": 2,"relationship": "nsubj"},
 {"target": 3,"source": 4,"relationship": "det"},
 {"target": 4,"source": 2,"relationship": "dobj"},
 {"target": 5,"source": 6,"relationship": "case"},
 {"target": 6,"source": 4,"relationship": "nmod"}
 ]
 }
 ]
 }
}
 Conll Example - Turkish {"src":"bir, iki, üç! Algorithmia Go!","format":"conll","language":"turkish"}
 {
 "output": {
 "sentences": [
 {
 "words": [
 {
 "lemma": "",
 "head": 2,
 "features": {
 "NumType": "Ord",
 "fPOS": "NUM++ANum"
 },
 "universal_pos": "NUM",
 "extra_deps": [""],
 "language_pos": "NNum",
 "misc": "",
 "dep_relation": "amod",
 "form": "bir,",
 "index": 1
 },
 {
 "lemma": "",
 "head": 3,
 "features": {
 "NumType": "Ord",
 "fPOS": "NUM++ANum"
 },
 "universal_pos": "NUM",
 "extra_deps": [""],
 "language_pos": "NNum",
 "misc": "",
 "dep_relation": "amod",
 "form": "iki,",
 "index": 2
 },
 {
 "lemma": "",
 "head": 0,
 "features": {
 "NumType": "Ord",
 "fPOS": "NUM++ANum"
 },
 "universal_pos": "NUM",
 "extra_deps": [""],
 "language_pos": "NNum",
 "misc": "",
 "dep_relation": "ROOT",
 "form": "üç!",
 "index": 3
 }
 ]
 },
 {
 "words": [
 {
 "lemma": "",
 "head": 2,
 "features": {
 "Case": "Nom",
 "Number": "Sing",
 "Person": "3",
 "fPOS": "PROPN++Prop"
 },
 "universal_pos": "PROPN",
 "extra_deps": [""],
 "language_pos": "Prop",
 "misc": "",
 "dep_relation": "name",
 "form": "Algorithmia",
 "index": 1
 },
 {
 "lemma": "",
 "head": 0,
 "features": {
 "Case": "Loc",
 "Number": "Sing",
 "Person": "3",
 "fPOS": "PROPN++Prop"
 },
 "universal_pos": "PROPN",
 "extra_deps": [""],
 "language_pos": "Prop",
 "misc": "",
 "dep_relation": "ROOT",
 "form": "Go!",
 "index": 2
 }
 ]
 }
 ]
 }
}

 Languages We've added a bunch of new languages with the tensorflow release of Parsey's Cousins . The newly supported languages are: Ancient Greek Arabic Basque Bulgarian Catalan Chinese Croatian Czech Danish Dutch English Estonian Finnish French Galician German Gothic Greek Hebrew Hindi Hungarian Indonesian Irish Italian Kazakh Latin Latvian Norwegian Old_Church_Slavonic Persian Polish Portuguese Portuguese-BR (Brazilian Portugese) Romanian Russian Slovenian Spanish Swedish Tamil Turkish Credits A TensorFlow implementation of the models described in Andor et al. (2016). The syntaxnet github repository is entirely open source and can be found here.

Tags
(no tags)

Cost Breakdown

10 cr
royalty per call
1 cr
usage per second
avg duration

Cost Calculator

API call duration (sec)
×
API calls
=
Estimated cost
per calls
for large volume discounts
For additional details on how pricing works, see Algorithmia pricing.

No permissions required

This algorithm does not require any special permissions.


To understand more about how algorithm permissions work, see the permissions documentation.

1. Type your input

2. See the result

Running algorithm...

3. Use this algorithm

curl -X POST -d '{{input | formatInput:"curl"}}' -H 'Content-Type: application/json' -H 'Authorization: Simple YOUR_API_KEY' https://api.algorithmia.com/v1/algo/deeplearning/Parsey/1.0.2
View cURL Docs
algo auth
# Enter API Key: YOUR_API_KEY
algo run algo://deeplearning/Parsey/1.0.2 -d '{{input | formatInput:"cli"}}'
View CLI Docs
import com.algorithmia.*;
import com.algorithmia.algo.*;

String input = "{{input | formatInput:"java"}}";
AlgorithmiaClient client = Algorithmia.client("YOUR_API_KEY");
Algorithm algo = client.algo("algo://deeplearning/Parsey/1.0.2");
AlgoResponse result = algo.pipeJson(input);
System.out.println(result.asJsonString());
View Java Docs
import com.algorithmia._
import com.algorithmia.algo._

val input = {{input | formatInput:"scala"}}
val client = Algorithmia.client("YOUR_API_KEY")
val algo = client.algo("algo://deeplearning/Parsey/1.0.2")
val result = algo.pipeJson(input)
System.out.println(result.asJsonString)
View Scala Docs
var input = {{input | formatInput:"javascript"}};
Algorithmia.client("YOUR_API_KEY")
           .algo("algo://deeplearning/Parsey/1.0.2")
           .pipe(input)
           .then(function(output) {
             console.log(output);
           });
View Javascript Docs
var input = {{input | formatInput:"javascript"}};
Algorithmia.client("YOUR_API_KEY")
           .algo("algo://deeplearning/Parsey/1.0.2")
           .pipe(input)
           .then(function(response) {
             console.log(response.get());
           });
View NodeJS Docs
import Algorithmia

input = {{input | formatInput:"python"}}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('deeplearning/Parsey/1.0.2')
print algo.pipe(input)
View Python Docs
library(algorithmia)

input <- {{input | formatInput:"r"}}
client <- getAlgorithmiaClient("YOUR_API_KEY")
algo <- client$algo("deeplearning/Parsey/1.0.2")
result <- algo$pipe(input)$result
print(result)
View R Docs
require 'algorithmia'

input = {{input | formatInput:"ruby"}}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('deeplearning/Parsey/1.0.2')
puts algo.pipe(input).result
View Ruby Docs
use algorithmia::*;

let input = {{input | formatInput:"rust"}};
let client = Algorithmia::client("YOUR_API_KEY");
let algo = client.algo('deeplearning/Parsey/1.0.2');
let response = algo.pipe(input);
View Rust Docs
Discussion
  • {{comment.username}}