Skip to content

Instantly share code, notes, and snippets.

@proycon
Created October 4, 2017 21:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save proycon/c7cf66ebf14f301b4accdb6f29dd18c0 to your computer and use it in GitHub Desktop.
Save proycon/c7cf66ebf14f301b4accdb6f29dd18c0 to your computer and use it in GitHub Desktop.
#/usr/bin/env python3
import json
from frog import Frog, FrogOptions
frog = Frog(FrogOptions(parser=False))
print(json.dumps( frog.process("Dit is een test.")))
@proycon
Copy link
Author

proycon commented Oct 4, 2017

Output example:

[{"index": "1", "text": "Dit", "lemma": "dit", "morph": "[dit]", "pos": "VNW(aanw,pron,stan,vol,3o,ev)", "posprob": 0.777085, "ner": "O", "chunker": "B-NP"}, {"index": "2", "text": "is", "lemma": "zijn", "morph": "[zijn]", "pos": "WW(pv,tgw,ev)", "posprob": 0.999891, "ner": "O", "chunker": "B-VP"}, {"index": "3", "text": "een", "lemma": "een", "morph": "[een]", "pos": "LID(onbep,stan,agr)", "posprob": 0.999113, "ner": "O", "chunker": "B-NP"}, {"index": "4", "text": "test", "lemma": "test", "morph": "[test]", "pos": "N(soort,ev,basis,zijd,stan)", "posprob": 0.903055, "ner": "O", "chunker": "I-NP"}, {"index": "5", "text": ".", "lemma": ".", "morph": "[.]", "pos": "LET()", "posprob": 1.0, "ner": "O", "chunker": "O", "eos": true}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment