コード例 #1
0
 def __init__(self, n=3):
     '''initialize with the ngram arity for the model we are building
 '''
     self.n = n  #bigrams?  trigrams? other?
     self.model = ()  # a tuple to store the model
     self.k = 5
     SmoothedModel.__init__(self)
コード例 #2
0
 def __init__(self, n=3):
   '''initialize with the ngram arity for the model we are building
   '''
   self.n = n  #bigrams?  trigrams? other?
   self.model = () # a tuple to store the model
   self.k = 5
   SmoothedModel.__init__(self)
コード例 #3
0
 def __init__(self, n=2):
     """Initialize your data structures in the constructor."""
     self.kn_ngram_prob = {}
     self.discount = 0.75
     self.full_discount = 0.0
     self.continuation_prob = {}
     self.n = n  # bigrams?  trigrams? other?
     SmoothedModel.__init__(self)
コード例 #4
0
 def __init__(self, n=2):
   """Initialize your data structures in the constructor."""
   self.kn_ngram_prob = {}
   self.discount = 0.75
   self.full_discount = 0.0
   self.continuation_prob = {}
   self.n = n  #bigrams?  trigrams? other?
   SmoothedModel.__init__(self)
コード例 #5
0
ファイル: tm_basic.py プロジェクト: JoeDumoulin/nlp_working
 def __init(self, n=3):
   self.n = n
   self.model = ()
   SmoothedModel.__init__(self)