cosmel.corpus.article module¶
-
class
cosmel.corpus.article.
Article
(file_path, root_path)[source]¶ Bases:
collections.abc.Sequence
The article object (contains list of sentences).
- Item: the word-segmented sentence (
WsWords
)
Parameters: -
parsed
¶ the parsed article of this article.
Type: ParsedArticle
-
bundle
¶ the mention bundle of this article.
Type: MentionBundle
- Item: the word-segmented sentence (
-
class
cosmel.corpus.article.
ArticleSet
(article_root, parts=[''], skips=[])[source]¶ Bases:
collections.abc.Collection
The set of articles.
- Item: the article object (
Article
)
Parameters: Notes
- Load all articles from
article_root
/part
for allpart
inparts
.
- Item: the article object (
-
class
cosmel.corpus.article.
Id2Article
(article_set)[source]¶ Bases:
collections.abc.Mapping
The dictionary maps article ID to article object.
- Key: the article ID (str).
- Item: the article object (
Article
).
Parameters: article_set ( ArticleSet
) – the article set.