In [1]:
from IPython.display import HTML
HTML("""<style>{}</style>""".format(open("assets/css/custom.css").read()))
Out[1]:
In [2]:
import processors
print("py-processors version:\t{}".format(processors.__version__))
print("processors-sever recommended version:\t{}".format(processors.__ps_rec__))
You can find the documentation here, including a detailed walkthrough example.
docker-based backend# pull the official image
docker pull myedibleenso/processors-server:3.2.1
# run the container in the background and expose the service on port 8886
docker run -d -e _JAVA_OPTIONS="-Xmx3G" -p 127.0.0.1:8886:8888 --name procserv myedibleenso/processors-server:3.1.0
Uncomment and run the next block to establish the client connection with the docker container-based backend.
In [3]:
# from processors import *
# API = ProcessorsBaseAPI(port=8886)
In [4]:
from processors import *
# using the jar-based backend
API = ProcessorsAPI(port=8881, keep_alive=False)
In [5]:
doc = API.annotate("To be loved by unicorns is the greatest gift of all.")
s = doc.sentences[0]
In [6]:
from processors.visualization import JupyterVisualizer as viz
viz.display_graph(s,graph_name="stanford-collapsed")
Let's see what the parse looks like for stanford basic dependencies ("stanford-basic")...
In [7]:
viz.display_graph(s, distance=150, graph_name="stanford-basic")
In [8]:
viz.display_graph(doc.sentences[0], css=viz.parse_css)
print("Corresponding CSS:\n{}".format(viz.parse_css))