CogComp-NLP

CogComp-NLP provides a suite of state-of-the-art Natural Language Processing (NLP) tools that allows you to annotate plain text inputs.

Java user? We have a JVM API!

Python user? We have a Python API!

  • Pipeline version in this demo

Enter text to annotate below (1500 characters limit), or select a sample document:

First you have to add it as a dependency to your project. If this package is used in maven, please add the following dependencies with proper repositories.
		

To process text input use the following pattern:
import edu.illinois.cs.cogcomp.annotation.AnnotatorService;
		  import edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation;
		  import edu.illinois.cs.cogcomp.pipeline.main.PipelineFactory;

		  String docId = "APW-20140101.3018"; // arbitrary string identifier
		  String textId = "body"; // arbitrary string identifier
		  String text = "Hello, how are you. I am doing fine"; // contains plain text to be annotated

		  AnnotatorService pipeline = PipelineFactory.buildPipeline(ViewNames.POS);
		  TextAnnotation ta = pipeline.createAnnotatedTextAnnotation( docId, textId, text );
		  System.out.println(ta.getAvailableViews()); // here you should see that the required views are added.
		  System.out.println(ta.getView(ViewNames.POS).getConstituents()); // will produce (UH Hello) (, ,) (WRB how) (VBP are) (PRP you) (. .) (PRP I) (VBP am) (VBG doing) (JJ fine)
	      

The output of this will be a tokenized document. If you want to add more views, you have to specify them either as arguments of buildPipeline. The method returns a `TextAnnotation` data structure , which contains a `View` corresponding to each annotation source. Each `View` contains a set of `Constituents` representing the annotator output. Here is how you can access views:
import edu.illinois.cs.cogcomp.core.datastructures.ViewNames;

		  System.out.println(ta.getAvailableViews()); // here you should see that the required views are added.
		  System.out.println(ta.getView(ViewNames.POS).getConstituents()); // will produce (UH Hello) (, ,) (WRB how) (VBP are) (PRP you) (. .) (PRP I) (VBP am) (VBG doing) (JJ fine)
	      
Take a look at our documentations to see more details.
First make sure you have "pip" on your system. Then install the package with "pip":
pip install cython
		    pip install ccg_nlpy

Here is a sample usage showing how to run our system:
from ccg_nlpy import remote_pipeline

		    pipeline = remote_pipeline.RemotePipeline()
		    doc = pipeline.doc("Hello, how are you. I am doing fine")
		    print(doc.get_lemma) # will produce (hello Hello) (, ,) (how how) (be are) (you you) (. .) (i I) (be am) (do doing) (fine fine)
		    print(doc.get_pos) # will produce (UH Hello) (, ,) (WRB how) (VBP are) (PRP you) (. .) (PRP I) (VBP am) (VBG doing) (JJ fine)
		
Take a look at our documentations to see more details.