🚀 テキストジャンル予測モデル
このモデルは、任意のウェブテキストのジャンルを予測するためのシンプルなモデルです。標準的なパイプラインに組み込むことが可能です。
🚀 クイックスタート
このモデルを使用するには、以下のようにtransformers
ライブラリのpipeline
を使用します。
基本的な使用法
from transformers import pipeline
classifier = pipeline("text-classification",model='ssharoff/genres')
print(classifier("Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it. `And what is the use of a book,' thought Alice `without pictures or conversation? So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her. There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, `Oh dear! Oh dear! I shall be late!' (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after it, and fortunately was just in time to see it pop down a large rabbit-hole under the hedge. In another moment down went Alice after it, never once considering how in the world she was to get out again. The rabbit-hole went straight on like a tunnel for some way, and then dipped suddenly down, so suddenly that Alice had not a moment to think about stopping herself before she found herself falling down a very deep well.", top_k=2))
print(classifier("The gratitude of every home in our Island, in our Empire, and indeed throughout the world, except in the abodes of the guilty, goes out to the British airmen who, undaunted by odds, unwearied in their constant challenge and mortal danger, are turning the tide of the World War by their prowess and by their devotion. Never in the field of human conflict was so much owed by so many to so few. ", top_k=2))
📚 ドキュメント
ジャンルコードとラベル
コード |
ラベル |
回答すべき質問 |
プロトタイプ |
A1 |
議論的 |
テキストが読者を説得して意見や見解を支持させるために議論している程度はどれくらいですか? |
議論的なブログ、社説、意見記事 |
A4 |
虚构的 |
テキストの内容が虚构的である程度はどれくらいですか? |
小説、詩、神話、映画のあらすじ |
A7 |
指示的 |
テキストが読者に何かの仕組みを教えたり、アドバイスを与えたりする目的である程度はどれくらいですか? |
チュートリアルやFAQ。質問のリスト自体も含まれます。 |
A8 |
報道的 |
テキストが最近の出来事に関する有益な報道である程度はどれくらいですか? |
ニュース報道。将来の出来事に関する情報も報道と見なすことができます。ニュース記事が状況のみを議論している場合は「なし」とします。 |
A9 |
法律的 |
テキストが一連の規則を指定している程度はどれくらいですか? |
法律、契約、著作権表示、利用規約 |
A11 |
個人的 |
テキストが一人称の話を報告している程度はどれくらいですか? |
日記、旅行ブログ |
A12 |
商業的 |
テキストが製品やサービスを宣伝している程度はどれくらいですか? |
広告、スパム |
A14 |
学術的 |
テキストが学術研究を報告している程度はどれくらいですか? |
学術研究論文 |
A16 |
情報的 |
テキストがこのテキストのトピックを定義するための参照情報を提供している程度はどれくらいですか? |
百科事典記事、辞書の定義、仕様書 |
A17 |
レビュー |
テキストが特定のエンティティを支持または批判することで評価している程度はどれくらいですか? |
製品、場所、パフォーマンスのレビュー |
注釈ガイドライン
注釈ガイドラインについては、こちらを参照してください。
予測のカテゴリ体系
予測のカテゴリ体系は以下の論文に基づいています。
@Article{sharoff18genres,
author = {Serge Sharoff},
title = {Functional Text Dimensions for the annotation of {Web} corpora},
journal = {Corpora},
volume = {13},
number = {1},
pages = {65--95},
year = {2018}
}
[http://corpus.leeds.ac.uk/serge/publications/2018-ftd.pdf]
📄 ライセンス
このモデルはCC BY-SA 4.0ライセンスの下で提供されています。