Permalink
Browse files

Whoa, MAJOR fix to NER NamedEntity object creation; MUCH simpler code…

… as a result. Yay. Meh progress on coreference though.
  • Loading branch information...
1 parent 7e83f57 commit 062f5f86d46057b21d7100414b1aa067d62e46d8 @dmnapolitano committed Mar 20, 2013
View
@@ -23,10 +23,11 @@ exception SerializedException
service StanfordCoreNLP
{
void ping(),
+ oneway void zip(),
list<ParseTree> parse_text(1:string text, 2:list<string> outputFormat),
ParseTree parse_tokens(1:list<string> tokens, 2:list<string> outputFormat),
- oneway void zip(),
list<NamedEntity> get_entities_from_text(1:string text),
list<NamedEntity> get_entities_from_tokens(1:list<string> tokens),
- list<NamedEntity> get_entities_from_trees(1:list<string> trees)
+ list<NamedEntity> get_entities_from_trees(1:list<string> trees),
+ list<string> resolve_coreferences_in_trees(1:list<string> trees)
}
@@ -24,12 +24,13 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print ''
print 'Functions:'
print ' void ping()'
+ print ' void zip()'
print ' parse_text(string text, outputFormat)'
print ' ParseTree parse_tokens( tokens, outputFormat)'
- print ' void zip()'
print ' get_entities_from_text(string text)'
print ' get_entities_from_tokens( tokens)'
print ' get_entities_from_trees( trees)'
+ print ' resolve_coreferences_in_trees( trees)'
print ''
sys.exit(0)
@@ -87,6 +88,12 @@ if cmd == 'ping':
sys.exit(1)
pp.pprint(client.ping())
+elif cmd == 'zip':
+ if len(args) != 0:
+ print 'zip requires 0 args'
+ sys.exit(1)
+ pp.pprint(client.zip())
+
elif cmd == 'parse_text':
if len(args) != 2:
print 'parse_text requires 2 args'
@@ -99,12 +106,6 @@ elif cmd == 'parse_tokens':
sys.exit(1)
pp.pprint(client.parse_tokens(eval(args[0]),eval(args[1]),))
-elif cmd == 'zip':
- if len(args) != 0:
- print 'zip requires 0 args'
- sys.exit(1)
- pp.pprint(client.zip())
-
elif cmd == 'get_entities_from_text':
if len(args) != 1:
print 'get_entities_from_text requires 1 args'
@@ -123,6 +124,12 @@ elif cmd == 'get_entities_from_trees':
sys.exit(1)
pp.pprint(client.get_entities_from_trees(eval(args[0]),))
+elif cmd == 'resolve_coreferences_in_trees':
+ if len(args) != 1:
+ print 'resolve_coreferences_in_trees requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.resolve_coreferences_in_trees(eval(args[0]),))
+
else:
print 'Unrecognized method %s' % cmd
sys.exit(1)
Oops, something went wrong.

0 comments on commit 062f5f8

Please sign in to comment.