public static String run(String model, ArrayList<String> list)
{
String taggedResult = "";
//set model and parameters
Tagger tagger = new Tagger("-m " + model);
// clear internal context
tagger.clear();
String fVector = "";
for(String s : list)
{
fVector += s;
}
//apply model / tag
tagger.parse(fVector);
/**
* get and refine tagged context
*/
for (int i = 0; i < tagger.size(); ++i) {
for (int j = 0; j < tagger.xsize(); ++j) {}
taggedResult += tagger.x(i, 0) + "\t" + tagger.y2(i) + "\n"; //get filename:TokenId and predicted label
}
tagger.delete();
return taggedResult;
}