概要
このモデルは、YelpAR レビュー・データセットに含まれるテキストと同様の英語のテキストを生成します。2 つの LSTM 層を持つ再帰型ニューラル・ネットワークからなるこのモデルは、YelpAR レビュー・データセットでトレーニングされています。生成モデルにシード値を与えるためのテキストをモデルに入力すると、生成されたテキストがモデルから出力されます。このモデルのベースとなっているのは、IBM コード・パターン: Training a Deep Learning Language Model Using Keras and Tensorflow です。
モデルのメタデータ
ドメイン | アプリケーション | 業種 | フレームワーク | トレーニング・データ | 入力データの形式 |
---|---|---|---|---|---|
テキスト/NLP | 言語モデル化 | 一般 | Keras | Kaggle Yelp レビュー・データセット | テキスト |
参考資料
- S. Hochreiter、J. Schmidhuber 共著「Long short-term memory」(Neural Computation 9(8):1735-1780、1997 年)
- Keras RNN 層 – LSTM
- IBM コード・パターン: Training a Deep Learning Language Model Using Keras and Tensorflow
ライセンス
コンポーネント | ライセンス | リンク |
---|---|---|
モデルの GitHub リポジトリー | Apache 2.0 | LICENSE |
モデルの重み | Apache 2.0 | LICENSE |
テスト・アセット | カスタム | アセットの README |
このモデルのデプロイ方法
このモデルは、以下のメカニズムを使用してデプロイできます。
- Docker Hub からデプロイする場合:
docker run -it -p 5000:5000 codait/max-review-text-generator
- Kubernetes 上にデプロイする場合:
kubectl apply -f https://raw.githubusercontent.com/IBM/MAX-Review-Text-Generator/master/max-review-text-generator.yaml
- ローカルにデプロイする場合: GitHub 上のモデルの README に記載されている手順に従います。
使用例
モデルをデプロイしたら、コマンド・ラインからモデルをテストできます。以下に例を示します。
curl -X POST --header 'Content-Type: application/json' -d '{"seed_text": "heart be still i loved this place. way better than i expected. i had the spicy noodles and they were delicious, flavor great and quality was on point. for desert the sticky rice with mango, i dream about it now. highly recommend if you are in the mood for "}' 'http://localhost:5000/model/predict'
以下のような JSON レスポンスが表示されるはずです。注: 文字の生成ステップではランダムなサンプルを使用することから、レスポンスで返される generated_text
フィールドの値は上記の結果とは異なります。
{
"status": "ok",
"prediction": {
"seed_text": "heart be still i loved this place. way better than i expected. i had the spicy noodles and they were delicious, flavor great and quality was on point. for desert the sticky rice with mango, i dream about it now. highly recommend if you are in the mood for ",
"generated_text": "made to make the coffee is friendly food in breads is delicy dep much to spice good, we went and bee",
"full_text": "heart be still i loved this place. way better than i expected. i had the spicy noodles and they were delicious, flavor great and quality was on point. for desert the sticky rice with mango, i dream about it now. highly recommend if you are in the mood for made to make the coffee is friendly food in breads is delicy dep much to spice good, we went and bee"
}
}