fix nltk package
parent
7f21a4fff9
commit
4e58f99806
|
@ -2,11 +2,12 @@ import random
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
import nltk
|
import nltk
|
||||||
nltk.data.path.append('/mnt/data/nltk_data')
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from utils.constants import IMAGENET_DEFAULT_TEMPLATES
|
from utils.constants import IMAGENET_DEFAULT_TEMPLATES
|
||||||
|
|
||||||
|
nltk.download('punkt', quiet=True)
|
||||||
|
nltk.download('averaged_perceptron_tagger', quiet=True)
|
||||||
|
|
||||||
def get_tag(tokenized, tags):
|
def get_tag(tokenized, tags):
|
||||||
if not isinstance(tags, (list, tuple)):
|
if not isinstance(tags, (list, tuple)):
|
||||||
|
|
Loading…
Reference in New Issue