parsing - Stanford Parser: how to extract dependencies? -


My job may be to find a query in a sentence (maybe noun + verb ), Then remove the object.

Example: "Coding is sometimes difficult task." My query will be: "coding is" .

You get the typed dependencies:

  nsubj (task-6, coding -1) police (task-6, two-two) advmod (task-6 , Sometimes -3) My program should remove the NSUbase Dependency, identify  "coding" as    as a query and  "work"  To save it  

It may seem easy, but by now, I have not found any method to remove the dependence of a specific type, and I want to end my work. A really need it.

Any

You can get dependency by the following code:

  tree tree = sentence.seat (tree annotation.class); // Obtain Dependency Tree TreeBangLanguageTLP = New PennTreebankLanguagePack (); Grammatical structure Edit GSF = TLP. GrammaticalStructureFactory (); Grammatical Structure GS = GSF Negmatic structure (tree); Collections & lt; TypedDependency & gt; Td = gs.typedDependenciesCollapsed (); Println (TD); Object [] list = td.toArray (); Println (list.length); Dependency typed dependency typed; (Object object: list) {typedDependency = (TypedDependency) object; System.out.println ("Deppency name" typedDependency.dep (). NodeString () + "::" + "node" + typed dependency .reln ()); ("Some")) {// your code}    .

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -