ckipnlp.container.seg module¶
This module provides containers for word-segmented sentences.
- class ckipnlp.container.seg.SegSentence(initlist=None)[source]¶
Bases:
BaseSentence0
A word-segmented sentence.
Data Structure Examples
- Text format
Used for
from_text()
andto_text()
.'中文字 耶 , 啊 哈 哈哈 。' # Words segmented by \u3000 (full-width space)
- List/Dict format
Used for
from_list()
,to_list()
,from_dict()
, andto_dict()
.[ '中文字', '耶', ',', '啊', '哈', '哈哈', '。', ]
Note
This class is also used for part-of-speech tagging.
- item_class¶
alias of
str
- class ckipnlp.container.seg.SegParagraph(initlist=None)[source]¶
Bases:
BaseList
A list of word-segmented sentences.
Data Structure Examples
- Text format
Used for
from_text()
andto_text()
.[ '中文字 耶 , 啊 哈 哈 。', # Sentence 1 '「 完蛋 了 ! 」 , 畢卡索 他 想', # Sentence 2 ]
- List/Dict format
Used for
from_list()
,to_list()
,from_dict()
, andto_dict()
.[ [ '中文字', '耶', ',', '啊', '哈', '哈哈', '。', ], # Sentence 1 [ '「', '完蛋', '了', '!', '」', ',', '畢卡索', '他', '想', ], # Sentence 2 ]
Note
This class is also used for part-of-speech tagging.
- item_class¶
alias of
SegSentence