- self.assertSequenceEqual(doc['tok/fine'], [
- ["商品", "和", "服务"],
- ["研究", "生命"]
- ])
-
- def test_skip_tok(self):
- pre_tokenized_sents = [
- ["商品和服务", '一个', '词'],
- ["研究", "生命"]
- ]
- doc: Document = mtl(pre_tokenized_sents, skip_tasks='tok*')
- self.assertSequenceEqual(doc['tok'], pre_tokenized_sents)
-
- def test_sdp_as_the_first_task(self):
- doc: Document = mtl(['人', '吃', '鱼'], tasks='sdp', skip_tasks='tok*')
- self.assertDictEqual(
- doc.to_dict(),
- {
- "sdp": [
- [(2, "Agt")],
- [(0, "Root")],