We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, How to tag input string? This library only works with input and output files. But I need to insert string and get predict labels.
The text was updated successfully, but these errors were encountered:
I also need to predict string data...
Sorry, something went wrong.
@uugan hi,I write a simple code, input feature String List and model path ,return predict result
public static List<List<Pair<String, Double>>> predict(List texts,String modelPath){ CrfTagger crfTagger = new CrfTagger(modelPath); List<List<Pair<String, Double>>> taggedSentences = new ArrayList(); List xseqs = new ArrayList(); ItemSequence xseq = new ItemSequence(); for (String text :texts){ String [] fields = text.split("\t"); Item item = new Item(); for (int i = 0; i < fields.length; ++ i){ String field = fields[i]; item.add(new Attribute(field)); } xseq.add(item); } xseqs.add(xseq); Iterator var = xseqs.iterator(); while(var.hasNext()) { ItemSequence xseq1 = (ItemSequence)var.next(); taggedSentences.add(crfTagger.tag(xseq1)); } return taggedSentences; }
No branches or pull requests
Hi,
How to tag input string? This library only works with input and output files. But I need to insert string and get predict labels.
The text was updated successfully, but these errors were encountered: