Open elahi123 opened 6 years ago
I am not sure what method you mean; the Serializer does not have a getContainer()
method. However, the following works as expected:
#!/usr/bin/env lsd
def tokenizer = new ServiceClient('http://eldrad.cs-i.brandeis.edu:8080/service_manager/invoker/brandeis_eldrad_grid_1:stanfordnlp.tokenizer_2.0.4', 'tester', 'tester')
def ner = new ServiceClient('http://eldrad.cs-i.brandeis.edu:8080/service_manager/invoker/brandeis_eldrad_grid_1:stanfordnlp.namedentityrecognizer_2.0.4', 'tester', 'tester')
Container container = new Container()
container.text = 'Karen flew to New York'
String json = new Data(Uri.LIF, container).asJson()
println 'Running the tokenizer'
json = tokenizer.execute(json)
println 'Running the NE recognizer'
json = ner.execute(json)
println 'Serializing'
Data data = Serializer.parse(json)
println data.discriminator
container = new Container(data.payload)
assert container.getViews().size() == 2
println 'PASSED'
The following lif file has two views but I think serializer .getContainer().getViews() gets only named entity view.
-----The lif file is generated by running named entity and tokenizer from http://galaxy.lappsgrid.org/