本文整理汇总了Python中datamodel.DataModel.topic_information方法的典型用法代码示例。如果您正苦于以下问题:Python DataModel.topic_information方法的具体用法?Python DataModel.topic_information怎么用?Python DataModel.topic_information使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datamodel.DataModel
的用法示例。
在下文中一共展示了DataModel.topic_information方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CWR
# 需要导入模块: from datamodel import DataModel [as 别名]
# 或者: from datamodel.DataModel import topic_information [as 别名]
#.........这里部分代码省略.........
overlap_color = QtGui.QColor(255, 255, 102) # Light Yellow
for string in result.overlap:
display.highlight(string, overlap_color)
'''
# Re-enable rationale selection.
for this_rationale in self._rationales:
this_rationale.display.setEnabled(True)
def update_statistics(self, topic=None, document=None):
self.update_gold_standard_view(topic, document)
self.update_topic_view(topic)
self.update_rationale_list()
self.update_judgment_list()
self.update_confusion_matrix(topic, document)
self.update_agreement_view(topic, document)
def update_confusion_matrix(self, topic=None, document=None):
cm = self._dm.confusion_matrix(topic, document)
self._confusion_matrix.setText(cm)
def update_gold_standard_view(self, topic, document):
'''
Updates the current gold standard view.
'''
if topic and document:
value = self._dm.gold_standard(topic, document)
self._gold_standard_view.setText("Gold Standard: %s" % value)
def update_topic_view(self, topic):
'''
Updates the current topic and rationale display.
'''
(topic, narrative) = self._dm.topic_information(topic)
self._topic_view.setText("<b>Topic</b>: %s" % topic)
self._narrative_view.setText("%s" % narrative)
def update_agreement_view(self, topic, document):
'''
Computes and updates the agreement for currently selected Topic or Document.
'''
d1_agree = self._dm.agreement(1, topic, document)
self._d1_agreement_view.setText("D1 Agreement: %f" % d1_agree)
d2_agree = self._dm.agreement(2, topic, document)
self._d2_agreement_view.setText("D2 Agreement: %f" % d2_agree)
def update_rationale_list(self):
'''
Updates the worker rationale list. If one or more worker IDs is
selected, this will display only the rationales by the selected
workers. Otherwise, this will display all rationales for the
selected Topic and Document.
'''
display_text = ''
selected = [r for r in self._rationales if r.display.isChecked()]
# If none are selected, display all.
selected = selected if selected else self._rationales
for r in selected:
display_text += ('%s\n\n%s\n\n' % (r.rationale.label, r.rationale.rationale.rationale))
self._worker_rationales.setText(display_text)
def update_judgment_list(self, topic=None, document=None):
'''
Updates the worker judgment list. If one or more worker IDs is
selected, this will display only the judgments of those selected