本文整理汇总了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")