當前位置: 首頁>>代碼示例>>Python>>正文


Python tokenization.printable_text方法代碼示例

本文整理匯總了Python中tokenization.printable_text方法的典型用法代碼示例。如果您正苦於以下問題:Python tokenization.printable_text方法的具體用法?Python tokenization.printable_text怎麽用?Python tokenization.printable_text使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tokenization的用法示例。


在下文中一共展示了tokenization.printable_text方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __repr__

# 需要導入模塊: import tokenization [as 別名]
# 或者: from tokenization import printable_text [as 別名]
def __repr__(self):
        s = ""
        s += "qas_id: %s" % (tokenization.printable_text(self.qas_id))
        s += ", question_text: %s" % (
            tokenization.printable_text(self.question_text))
        s += ", doc_tokens: [%s]" % (" ".join(self.doc_tokens))
        if self.start_position:
            s += ", start_position: %d" % (self.start_position)
        if self.start_position:
            s += ", end_position: %d" % (self.end_position)
        return s 
開發者ID:eva-n27,項目名稱:BERT-for-Chinese-Question-Answering,代碼行數:13,代碼來源:run_squad.py

示例2: __repr__

# 需要導入模塊: import tokenization [as 別名]
# 或者: from tokenization import printable_text [as 別名]
def __repr__(self):
    s = ""
    s += "qas_id: %s" % (tokenization.printable_text(self.qas_id))
    s += ", question_text: %s" % (
        tokenization.printable_text(self.question_text))
    s += ", doc_tokens: [%s]" % (" ".join(self.doc_tokens))
    if self.start_position:
      s += ", start_position: %d" % (self.start_position)
    if self.start_position:
      s += ", end_position: %d" % (self.end_position)
    if self.start_position:
      s += ", is_impossible: %r" % (self.is_impossible)
    return s 
開發者ID:Nagakiran1,項目名稱:Extending-Google-BERT-as-Question-and-Answering-model-and-Chatbot,代碼行數:15,代碼來源:run_squad.py

示例3: __str__

# 需要導入模塊: import tokenization [as 別名]
# 或者: from tokenization import printable_text [as 別名]
def __str__(self):
    s = ""
    s += "tokens: %s\n" % (" ".join(
        [tokenization.printable_text(x) for x in self.tokens]))
    s += "segment_ids: %s\n" % (" ".join([str(x) for x in self.segment_ids]))
    s += "is_random_next: %s\n" % self.is_random_next
    s += "masked_lm_positions: %s\n" % (" ".join(
        [str(x) for x in self.masked_lm_positions]))
    s += "masked_lm_labels: %s\n" % (" ".join(
        [tokenization.printable_text(x) for x in self.masked_lm_labels]))
    s += "\n"
    return s 
開發者ID:Nagakiran1,項目名稱:Extending-Google-BERT-as-Question-and-Answering-model-and-Chatbot,代碼行數:14,代碼來源:create_pretraining_data.py

示例4: __repr__

# 需要導入模塊: import tokenization [as 別名]
# 或者: from tokenization import printable_text [as 別名]
def __repr__(self):
    s = ""
    s += "qas_id: %s" % (tokenization.printable_text(self.qas_id))
    s += ", question_text: %s" % (
        tokenization.printable_text(self.question_text))
    s += ", doc_tokens: [%s]" % (" ".join(self.doc_tokens))
    if self.start_position:
      s += ", start_position: %d" % (self.start_position)
    if self.start_position:
      s += ", end_position: %d" % (self.end_position)
    return s 
開發者ID:ymcui,項目名稱:Cross-Lingual-MRC,代碼行數:13,代碼來源:run_clmrc.py

示例5: __str__

# 需要導入模塊: import tokenization [as 別名]
# 或者: from tokenization import printable_text [as 別名]
def __str__(self):
		s = ""
		s += "tokens: %s\n" % (" ".join(
				[tokenization.printable_text(x) for x in self.tokens]))
		s += "segment_ids: %s\n" % (" ".join([str(x) for x in self.segment_ids]))
		s += "is_random_next: %s\n" % self.is_random_next
		s += "masked_lm_positions: %s\n" % (" ".join(
				[str(x) for x in self.masked_lm_positions]))
		s += "masked_lm_labels: %s\n" % (" ".join(
				[tokenization.printable_text(x) for x in self.masked_lm_labels]))
		s += "\n"
		return s 
開發者ID:yyht,項目名稱:BERT,代碼行數:14,代碼來源:create_pretraining_data.py

示例6: __repr__

# 需要導入模塊: import tokenization [as 別名]
# 或者: from tokenization import printable_text [as 別名]
def __repr__(self):
        s = ""
        s += "qas_id: %s" % (tokenization.printable_text(self.qas_id))
        s += ", question_text: %s" % (
            tokenization.printable_text(self.question_text))
        s += ", doc_tokens: [%s]" % (" ".join(self.doc_tokens))
        if self.start_position:
            s += ", start_position: %d" % (self.start_position)
        if self.start_position:
            s += ", end_position: %d" % (self.end_position)
        if self.start_position:
            s += ", is_impossible: %r" % (self.is_impossible)
        return s 
開發者ID:husseinmozannar,項目名稱:SOQAL,代碼行數:15,代碼來源:Bert_model.py

示例7: __str__

# 需要導入模塊: import tokenization [as 別名]
# 或者: from tokenization import printable_text [as 別名]
def __str__(self):
        s = ""
        s += "tokens: %s\n" % (" ".join(
            [tokenization.printable_text(x) for x in self.tokens]))
        s += "segment_ids: %s\n" % (" ".join(
            [str(x) for x in self.segment_ids]))
        s += "is_random_next: %s\n" % self.is_random_next
        s += "masked_lm_positions: %s\n" % (" ".join(
            [str(x) for x in self.masked_lm_positions]))
        s += "masked_lm_labels: %s\n" % (" ".join(
            [tokenization.printable_text(x) for x in self.masked_lm_labels]))
        s += "\n"
        return s 
開發者ID:guoyaohua,項目名稱:BERT-Chinese-Annotation,代碼行數:15,代碼來源:create_pretraining_data.py

示例8: __repr__

# 需要導入模塊: import tokenization [as 別名]
# 或者: from tokenization import printable_text [as 別名]
def __repr__(self):
        s = ""
        s += "qas_id: %s" % (tokenization.printable_text(self.qas_id))
        s += ", question_text: %s" % (
            tokenization.printable_text(self.question_text))
        s += ", doc_tokens: [%s]" % (" ".join(self.doc_tokens))
        if self.start_position:
            s += ", start_position: %d" % (self.start_position)
        if self.start_position:
            s += ", end_position: %d" % (self.end_position)
        if self.history_answer_marker:
            s += ', history_answer_marker: {}'.format(json.dumps(self.history_answer_marker))
        if self.metadata:
            s += ', metadata: ' + json.dumps(self.metadata)
        return s 
開發者ID:prdwb,項目名稱:bert_hae,代碼行數:17,代碼來源:cqa_supports.py


注:本文中的tokenization.printable_text方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。