Skip to content

eddotman/pyfactorie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyfactorie

Build Status

Python wrapper for Factorie NLP package.

Installation

Use PyPI:

pip install pyfactorie

Usage

First, have the Factorie package installed. Run the nlp server (example run command below):

bin/fac nlp --wsj-forward-pos --transition-based-parser --conll-chain-ner

Then use the parse_sentence("YOUR_SENTENCE") to throw sentences at the parser and receive nested node structures. Each node will look like this:

#Node
{
    "name": str,
    "children": [Node],
    "data": {
        "id":        int,
        "sent_id":   int,
        "pos":       str,
        "parent_id": int,
        "phrase":    str
    }
}

Each node can add_child(Node) which works in exactly the way you would expect. There is also a NodeHandler class that helps with some basic search and traversing algorithms.

About

Python wrapper for Factorie

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages