Skip to content

Commit

Permalink
Updated to nltk==3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
w11wo committed Dec 9, 2024
1 parent a22c3d5 commit 520073c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion g2p_id/g2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import os
import re
import pickle
import unicodedata
from builtins import str as unicode
from itertools import permutations
Expand Down Expand Up @@ -94,7 +95,8 @@ def __init__(self, model_type="BERT"):
self.normalizer = TextProcessor()
self.tagger = PerceptronTagger(load=False)
tagger_path = os.path.join(resources_path, "id_posp_tagger.pickle")
self.tagger.load("file://" + tagger_path)
with open(tagger_path, "rb") as f:
self.tagger = self.tagger.decode_json_obj(pickle.load(f))
self.model: Union[BERT, LSTM] = BERT() if model_type == "BERT" else LSTM()
self.tokenizer = TweetTokenizer()
self.pos_dict = {
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
num2words
nltk==3.8.1
nltk==3.9
onnxruntime

0 comments on commit 520073c

Please sign in to comment.