本文整理匯總了Python中composes.composition.lexical_function.LexicalFunction.export方法的典型用法代碼示例。如果您正苦於以下問題:Python LexicalFunction.export方法的具體用法?Python LexicalFunction.export怎麽用?Python LexicalFunction.export使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類composes.composition.lexical_function.LexicalFunction
的用法示例。
在下文中一共展示了LexicalFunction.export方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_lexical_function
# 需要導入模塊: from composes.composition.lexical_function import LexicalFunction [as 別名]
# 或者: from composes.composition.lexical_function.LexicalFunction import export [as 別名]
def test_lexical_function(self):
self.m12 = DenseMatrix(np.mat([[3,1],[9,2]]))
self.m22 = DenseMatrix(np.mat([[4,3],[2,1]]))
self.ph2 = DenseMatrix(np.mat([[18,11],[24,7]]))
self.row = ["a", "b"]
self.ft = ["f1","f2"]
self.space1 = Space(DenseMatrix(self.m12), self.row, self.ft)
self.space2 = Space(DenseMatrix(self.ph2), ["a_a","a_b"], self.ft)
m = LexicalFunction()
m._MIN_SAMPLES = 1
self.assertRaises(IllegalStateError, m.export, self.prefix + ".lf1")
m.train([("a","b","a_b"),("a","a","a_a")], self.space1, self.space2)
m.export(self.prefix + ".lf2")