Created
December 12, 2018 09:06
-
-
Save mahimrocky/79dd44df006e795ea480ae004cd637d1 to your computer and use it in GitHub Desktop.
Preparing and open token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void openTokenzition() { | |
InputStream is; | |
TokenizerModel tm; | |
try { | |
is = getAssets().open("en-token.bin"); | |
tm = new TokenizerModel(is); | |
tokenizer = new TokenizerME(tm); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
public void openNameFinder() { | |
InputStream is; | |
TokenNameFinderModel tokenNameFinderModel; | |
try { | |
is = getAssets().open("en-ner-person.bin"); | |
tokenNameFinderModel = new TokenNameFinderModel(is); | |
nameFinderME = new NameFinderME(tokenNameFinderModel); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment