MCPcopy
hub / github.com/hankcs/HanLP / get_frames

Method get_frames

hanlp/components/amr/seq2seq/dataset/dataset.py:48–57  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

46 return roles
47
48 def get_frames(self):
49 frames = Counter()
50 for sample in self.data:
51 g: Graph = sample['amr']
52 for i in g.instances():
53 t = i.target
54 cells = t.split('-')
55 if len(cells) == 2 and len(cells[1]) == 2 and cells[1].isdigit():
56 frames[t] += 1
57 return frames
58
59
60class AMRPickleDataset(AMRDataset):

Callers 1

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected