Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from underthesea.corpus.corpus import Corpus
from underthesea.corpus.document import Document
from underthesea.feature_engineering.unicode import UnicodeTransformer
from underthesea.corpus.plaintext import PlainTextCorpus
from underthesea.corpus.readers.dictionary_loader import DictionaryLoader
viet_dict_11K = DictionaryLoader('Viet11K.txt')
viet_dict_22K = DictionaryLoader('Viet22K.txt')
viet_dict_39K = DictionaryLoader('Viet39K.txt')
viet_dict_74K = DictionaryLoader('Viet74K.txt')
__all__ = ['Corpus', 'Document', 'UnicodeTransformer', 'PlainTextCorpus', 'DictionaryLoader']
import time
from underthesea.corpus.readers.dictionary_loader import DictionaryLoader
words = set(DictionaryLoader('Viet74K.txt').words)
def word2features(sent, i):
"""
add feature for each word
:param unicode|str sent: input sentence
:param int i: index of word in sentence
:return: word added feature
:rtype: list
"""
word = sent[i][0]
features = [
word,
'bias',
'word.lower=' + word.lower(),
from underthesea.corpus.corpus import Corpus
from underthesea.corpus.document import Document
from underthesea.feature_engineering.unicode import UnicodeTransformer
from underthesea.corpus.plaintext import PlainTextCorpus
from underthesea.corpus.readers.dictionary_loader import DictionaryLoader
viet_dict_11K = DictionaryLoader('Viet11K.txt')
viet_dict_22K = DictionaryLoader('Viet22K.txt')
viet_dict_39K = DictionaryLoader('Viet39K.txt')
viet_dict_74K = DictionaryLoader('Viet74K.txt')
__all__ = ['Corpus', 'Document', 'UnicodeTransformer', 'PlainTextCorpus', 'DictionaryLoader']
from underthesea.corpus.corpus import Corpus
from underthesea.corpus.document import Document
from underthesea.feature_engineering.unicode import UnicodeTransformer
from underthesea.corpus.plaintext import PlainTextCorpus
from underthesea.corpus.readers.dictionary_loader import DictionaryLoader
viet_dict_11K = DictionaryLoader('Viet11K.txt')
viet_dict_22K = DictionaryLoader('Viet22K.txt')
viet_dict_39K = DictionaryLoader('Viet39K.txt')
viet_dict_74K = DictionaryLoader('Viet74K.txt')
__all__ = ['Corpus', 'Document', 'UnicodeTransformer', 'PlainTextCorpus', 'DictionaryLoader']
from underthesea.corpus.corpus import Corpus
from underthesea.corpus.document import Document
from underthesea.feature_engineering.unicode import UnicodeTransformer
from underthesea.corpus.plaintext import PlainTextCorpus
from underthesea.corpus.readers.dictionary_loader import DictionaryLoader
viet_dict_11K = DictionaryLoader('Viet11K.txt')
viet_dict_22K = DictionaryLoader('Viet22K.txt')
viet_dict_39K = DictionaryLoader('Viet39K.txt')
viet_dict_74K = DictionaryLoader('Viet74K.txt')
__all__ = ['Corpus', 'Document', 'UnicodeTransformer', 'PlainTextCorpus', 'DictionaryLoader']