Невозможно создать граф понятий в графено
Я использую Grafeno для создания концептуальных графиков. Иногда это работает отлично, а иногда нет для какого-то текста. Тестирую на тексте из разных доменов. Я обнаружил, что это не удается, если вводимый текст большой и содержит больше числовых данных.
text = """In our original studies, we recommended that policymakers
and online instructors consider employing the tested behavioral
interventions in their own MOOCs (12–14); we now conclude
that further research is necessary to predict in advance when
these interventions will help populations of students in need. The
population of students who complete surveys in MOOCs is exceptionally diverse along certain dimensions, but may not capture aspects of other populations of interest: For example, less
engaged students or those in other educational settings."""
G2 = Graph(text=text, transformer=T)
visualize(G2)
Сообщение об ошибке. Как я могу решить эту проблему.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-17-27308a0f4ae9> in <module>
7 engaged students or those in other educational settings."""
8
----> 9 G2 = Graph(text=text, transformer=T)
10 visualize(G2)
~/Desktop/cg/grafeno-master/grafeno/graph.py in __init__(self, original, transformer, transformer_args, text, subgraph, from_networkx)
79 self.transformer = transformer(graph=self, **transformer_args)
80 if text:
---> 81 self.add_text(text)
82
83 # Building the graph
~/Desktop/cg/grafeno-master/grafeno/graph.py in add_text(self, text)
138 A clean text to process and add to the graph.
139 '''
--> 140 self.transformer.transform_text(text)
141
142 # Examining the graph
~/Desktop/cg/grafeno-master/grafeno/transformers/base.py in transform_text(self, text)
62 self.transform_tree(tree)
63 self.stage = "post_process"
---> 64 self.post_process()
65 self.stage = "add_to_graph"
66 self._id_map = self._add_to_graph()
~/Desktop/cg/grafeno-master/grafeno/transformers/lenient.py in post_process(self)
10
11 def post_process (self):
---> 12 super().post_process()
13 for edge in self.edges:
14 try:
~/Desktop/cg/grafeno-master/grafeno/transformers/relative.py in post_process(self)
10
11 def post_process (self):
---> 12 super().post_process()
13 for e in self.edges:
14 if e.get('functor') == 'RESTR':
~/Desktop/cg/grafeno-master/grafeno/transformers/conjunction.py in post_process(self)
20 new_edges = []
21 for s in conj['conj_siblings']:
---> 22 verb_conjunction = conj['sempos'] == 'v' and s['sempos'] == 'v'
23 if verb_conjunction:
24 new_edges.append({'parent':conj_id,'child':s['id'],'functor':'SEQ'})
KeyError: 'sempos'
Пример текста, где он работает нормально.
text = """This issue presents information on the International Conference on Postharvest Pest and Disease Management in Exporting Horticultural Crops - PPDM2012, held at Bangkok, Thailand on 21 February, 2012. The printed volume contains 32 articles covering various topics of relevance to postharvest pest and disease management in horticultural crops, its processing and quality. Control mechanisms discussed include biotic (biocontrol, antimicrobial extracts) and abiotic (irradiation, heat, fumigation, photocatalysis); and plant defence strategies and packaging are also discussed. These proceedings are also available in CD-ROM format."""