AWSが提供するAIサービス関連のリンクをまとめる。
AIサービスとは
機械学習の深い知識なしに簡単にAIを利用できるサービス
公式
AWS サービス別資料 - Machine Learning
https://aws.amazon.com/jp/aws-jp-introduction/aws-jp-webinar-service-cut/#ai-wn
AWS AI/ML ポータル
https://aws.amazon.com/jp/machine-learning/
Amazon Augmented AI
英語
https://www.youtube.com/watch?v=jNUp1SO_0YU
Amazon Bedrock
【事例】非構造化データから構造化データへ~Amazon Bedrock での Claude 利活用~
https://atlaxblogs.nri.co.jp/entry/20231116
Amazon CodeGuru
Amazon Comprehend
日本語のTopicモデルは1文字ごとに適用されてしまうため、利用が難しい。
日本語 -> 英語 に変換してからTopicモデルを適用した方が現実的。
【公式】ハンズオン
https://awsj-lang-workshop.s3.ap-northeast-1.amazonaws.com/comprehend_handson.pdf
【公式】ハンズオン(Polly -> Transcribe -> Complehend)
https://awsj-lang-workshop.s3.ap-northeast-1.amazonaws.com/language_service_handson.pdf
【公式】BlackBelt AWSにおける音声文字起こしとテキスト分析サービスの紹介と分析結果の可視化例
https://pages.awscloud.com/rs/112-TZM-766/images/20201007_VoC_Seminar.pdf
【事例】Contact Center Intelligence を活用した CX の改善
https://resources.awscloud.com/aws-ai-and-machine-learning-japan-aws-innovate/improving-cx-with-contact-center-intelligence-jp
【事例】AWS re:Invent 2020: Discovering insights from customer surveys at McDonald’s
https://www.youtube.com/watch?v=la2dHBYJPoI
Amazon Comprehend Medical
Amazon Forecast
Amazon Forecast Introduction, Best Practices, and Cheat Sheet Tutorial
https://github.com/aws-samples/amazon-forecast-samples/blob/master/ForecastCheatSheet.md
データ特性ごとに適したアルゴリズムの説明や、データ準備のためのノートブックもある、最強の実践ガイド
(ただし英語)
未来を予測する︕ Amazon Forecast の Tips とユースケース
https://pages.awscloud.com/rs/112-TZM-766/images/AWS-23_AWS_Summit_Online_2020_AIM02.pdf
・学習データを置くS3は、別リージョンでもOK
【公式WhitePaper】Time Series Forecasting Principles with Amazon Forecast
https://d1.awsstatic.com/whitepapers/time-series-forecasting-principles-amazon-forecast.pdf
Time Series Forecasting Principles with Amazon Forecast
https://d1.awsstatic.com/whitepapers/time-series-forecasting-principles-amazon-forecast.pdf
信頼区間と予測区間の違い
https://www.i-juse.co.jp/statistics/support/faq/80025.html
Amazon Forecastは予測区間
Amazon ForecastのDeepAR+で追加された新しいハイパーパラメータを確認する
https://dev.classmethod.jp/articles/amazon-forecast-deepar-new-hyperparameter/
ターゲット時系列データセットタイプ
https://docs.aws.amazon.com/ja_jp/forecast/latest/dg/retail-domain.html#target-time-series-type-retail-domain
TargetTimeSeriesには、item_idごとのターゲット値の他に、分解したい単位のカラムを入れる。(例:アイテム別(item_id)、店別(store_id)ごとに予測を得たい場合など)
スパースなデータは予測できないよ!の論文
Amazon Forecast と Stepfunctions を利用した MLops パイプラインの構築
アルゴリズム
Amazon Forecast can now use Convolutional Neural Networks (CNNs) to train forecasting models up to 2X faster with up to 30% higher accuracy
https://aws.amazon.com/blogs/machine-learning/amazon-forecast-can-now-use-convolutional-neural-networks-cnns-to-train-forecasting-models-up-to-2x-faster-with-up-to-30-higher-accuracy/
学習にかかった時間を算出するには
DescribePredictor APIを使う
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/forecast.html#ForecastService.Client.describe_predictor
'CreationTime': datetime.datetime(2020, 8, 15, 11, 6, 15, 325000, tzinfo=tzlocal()),
'LastModificationTime': datetime.datetime(2020, 8, 15, 12, 39, 8, 671000, tzinfo=tzlocal()),
これら2つの差分をとる('LastModificationTime' - 'CreationTime')
ただし、コストは算出できない(裏で複数のインスタンスが並列していることがあり、経過時間からはインスタンス稼働時間が必ずしも算出できないため。改善してほしい。。)
MLOps を適用して、Amazon Forecast で AI を利用した予測の自動化を構築する
https://aws.amazon.com/jp/blogs/news/building-ai-powered-forecasting-automation-with-amazon-forecast-by-applying-mlops/
Lambda、Step Functions、CloudWatch Events ルールで Amazon Forecast ワークフローを自動化する
https://aws.amazon.com/jp/blogs/news/automating-your-amazon-forecast-workflow-with-lambda-step-functions-and-cloudwatch-events-rule/
【AWSソリューション】機械学習を使用して予測の精度を向上
https://aws.amazon.com/jp/solutions/implementations/improving-forecast-accuracy-with-machine-learning/?nc1=h_ls
【公式】AIM312 Predict future business outcomes using Amazon Forecast
https://d1.awsstatic.com/events/reinvent/2019/Predict_future_business_outcomes_using_Amazon_Forecast_AIM312.pdf
【公式】ForecastはVPC Endpoint(Private Link)未対応(2020.11.23時点)
https://docs.aws.amazon.com/ja_jp/forecast/latest/dg/aws-forecast-iam-roles.html
Forecast は AWS VPC と通信できないため、S3 VPCE ゲートウェイをサポートできません。VPCアクセスのみを許可するS3バケットを使用すると、 AccessDenied エラーです。
<参考>PrivateLinkに対応しているサービスを知るには
https://qiita.com/mksamba/items/20903940b8b256ef2487
VPCの、エンドポイント>エンドポイントの作成 で表示されるサービス一覧が、PrivateLinkに対応しているサービスである。そのまま見てもよし、検索してもよし。
その他Tips
・予測できる期間は、学習データの1/3が最大。(3ヶ月の学習データなら、1ヶ月先まで)
https://recipe.kc-cloud.jp/archives/16959
また、Amazon Forecast で予測できる期間はインポートしたデータの1/3までです。今後1ヶ月の予測をしたい場合は、少なくとも直近3ヶ月分のデータが必要となります。
・importデータの指定は、ファイルまたはバケット(フォルダ)を指定することができる
https://docs.aws.amazon.com/ja_jp/forecast/latest/dg/dataset-import-guidelines-troubleshooting.html
Amazon S3 ファイルまたはバケット
データセットをインポートするとき、データを含む Amazon Simple Storage Service (Amazon S3) バケットの CSV ファイルへのパス、またはデータを含む S3 バケットの名前を指定できます。CSV ファイルを指定すると、Forecast はそのファイルのみをインポートします。S3 バケットを指定すると、Forecast はバケット内のすべての CSV ファイルを最大 10,000 ファイルインポートします。バケット名を指定して複数のファイルをインポートする場合は、すべての CSV ファイルが、指定されたスキーマに準拠する必要があります。
新商品・コールドスタートへの対応
【公式事例】需要予測から自動発注へ – Amazon Forecast による自動化された機械学習で在庫切れ、過剰在庫、コストを削減
https://aws.amazon.com/jp/blogs/news/from-forecasting-demand-to-ordering-an-automated-machine-learning-approach-with-amazon-forecast-to-decrease-stock-outs-excess-inventory-and-costs-jp/
【公式事例】CUS-57:大阪ガスが実践する IoT サービスと新サービスへの Amazon Forecast の活用
https://resources.awscloud.com/aws-summit-online-japan-2020-on-demand-industry-2-55513
【AWS blog】Measuring forecast model accuracy to optimize your business objectives with Amazon Forecast
https://aws.amazon.com/blogs/machine-learning/measuring-forecast-model-accuracy-to-optimize-your-business-objectives-with-amazon-forecast/
どのメトリクス(指標)をどのユースケースで利用すべきかのガイド表あり
Amazon Fraud Detector
【公式】ユーザーガイド
https://docs.aws.amazon.com/frauddetector/latest/ug/what-is-frauddetector.html
【公式】製品紹介ページ
https://aws.amazon.com/jp/fraud-detector/
【公式】よくある質問
https://aws.amazon.com/jp/fraud-detector/faqs/
参考:その他の不正検知ソリューション:IP Insight
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/ip-insights.html
SageMakerのビルトインアルゴリズム
Amazon SageMaker IP Insights アルゴリズムを使用して、不審な IP アドレスを検出する
https://aws.amazon.com/jp/blogs/news/detect-suspicious-ip-addresses-with-the-amazon-sagemaker-ip-insights-algorithm/
SageMakerソリューション紹介
Amazon Kendra
Kendraに関連ある論文
Multi-passage BERT: A Globally Normalized BERT Model for Open-domain Question Answering
https://arxiv.org/pdf/1908.08167.pdf
BERT-RC
End-to-End Synthetic Data Generation for Domain Adaptation of Question Answering Systems
https://arxiv.org/pdf/2010.06028.pdf
Zero-Shot Open-Book Question Answering
https://arxiv.org/pdf/2111.11520.pdf
AWS CORD-19 Search: A Neural Search Engine for VOVID-19 Literature
https://arxiv.org/pdf/2007.09186.pdf
Kendraの機能が紹介されている。
Document ranking:DR
Passage ranking:PR
Question Answering:QA
FAQ Matching:FAQM
Amazon Lex
【公式:builders.flash】1 時間で Amazon Lex の掛け算九九練習ボットを作る
https://aws.amazon.com/jp/builders-flash/202110/lex-times-table-bot
【事例】Amazon Connectで実現した「働き方」と「顧客体験」変革
https://d1.awsstatic.com/events/jp/2021/summit-online/PAR-09_AWS_Summit_Japan_2021_Serverworks.pdf
Lexではないが、Amazon Connectによるコールセンタ構築の例
【事例】TEPCOが挑戦した AI x オムニチャネルコンタクトセンター - Amazon Connect(+ AmiVoice)活用 - 認識率60%
https://d1.awsstatic.com/events/jp/2021/summit-online/CUS-05_AWS_Summit_Online_2021_TEPCO_EP.pdf
こちらもAmazon Connect
デモ
https://www.youtube.com/watch?v=wMiVwxwKNpA&t=1166s
【事例:Connect + Lex】CX 向上に向けた楽天保険グループの次世代コンタクトセンター構築への挑戦(CUS-34)
https://www.youtube.com/watch?v=PvmANFraLmE
Alexaのアルゴリズム
LexはAlaxaと同じ技術(おそらくDLモデル)が使われているため、Alexaの公開情報も参考
Alexaでの自然言語理解
https://www.youtube.com/watch?v=U1yT_4xcglY&t=1493s
The science behind Alexa Conversations | Amazon Science
https://www.youtube.com/watch?v=M9C0P4-UaNQ&t=251s
DLモデルの概要が説明されている
サンプル
Amazon Personalize
KDDでbest論文賞を獲得
https://www.amazon.science/blog/amazon-researchers-win-best-paper-award-at-kdd
チートシート
https://github.com/aws-samples/amazon-personalize-samples/blob/master/PersonalizeCheatSheet2.0.md
【開催報告】AWS AI/ML@Tokyo #4
https://aws.amazon.com/jp/blogs/news/aws-aiml-tokyo4/
「BASEでのAWS Personalizeを活用したレコメンドシステム構築事例」
Amazon Personalize の概要
https://pages.awscloud.com/event_JAPAN_Hands-on-Amazon-Personalize-Forecast-2019.html?trk=aws_introduction_page
20190716 AWS Black Belt Online Seminar Amazon Personalize
https://www.slideshare.net/AmazonWebServicesJapan/20190716-aws-black-belt-online-seminar-amazon-personalize
Amazon Personalize がコンテキスト推奨をサポート開始
https://aws.amazon.com/jp/about-aws/whats-new/2019/12/amazon-personalize-supports-contextual-recommendations/
これにより、コンテキスト内で、デバイスタイプ、場所、時刻などの推奨事項を生成することにより、推奨事項の関連性を向上させることができます。コンテキスト情報は、ユーザーの過去の対話が不明な場合でも、新規/未確認のユーザーをパーソナライズ化する場合も役立ちます。
Amazon Personalize の推奨スコアのご紹介
https://aws.amazon.com/jp/blogs/news/introducing-recommendation-scores-in-amazon-personalize/
[アップデート] Amazon Personalizeに選択したEventTypeのアイテムをレコメンドから除外するフィルターが追加されました
https://dev.classmethod.jp/articles/amazon-personalize-update-recommendation-filter/
バッチレコメンデーションを行う場合の罠
バッチレコメンデーションを取得するには、CreateBatchInferenceJob オペレーションを呼び出す IAM ユーザーロールに、入力および出力 Amazon S3 バケットに対する読み取りおよび書き込みアクセス許可が必要です。
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:ListBucket"
],
"s3:PutObject"を追加することがわからないくで、半日消化した。。。
https://aws.amazon.com/jp/blogs/news/now-available-batch-recommendations-in-amazon-personalize/
このブログのおかげで気づけました。
【公式ブログ】Amazon Personalize Monitor
https://github.com/aws-samples/amazon-personalize-monitor
本番環境におけるTPSなどのモニタリングができるソリューション
【公式ブログ】Amazon Personalize を使用して StockX でパーソナライズされたユーザーエクスペリエンスを先駆けて提供
https://aws.amazon.com/jp/blogs/news/pioneering-personalized-user-experiences-at-stockx-with-amazon-personalize/
AWS re:Invent 2020: Pioneering user experiences at StockX with Amazon Personalize
https://www.youtube.com/watch?v=KohnWj_90b4
上記StockXの事例紹介動画
ハンズオン
https://ai-services.go-aws.com/50_personalize/70_appconfig/90_pluginmodels.html
Amazon Polly
Amazon Rekognition
【公式】Rekognitionの上限
https://docs.aws.amazon.com/ja_jp/rekognition/latest/dg/limits.html
【公式】カスタムラベルの上限
https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/limits.html
Amazon Textract
[AWS Black Belt Online Seminar] AWS AI Language Services 資料及び QA 公開
https://aws.amazon.com/jp/blogs/news/webinar-bb-aws-ai-language-services-2020/
GitHub
https://github.com/aws-samples/amazon-textract-code-samples/blob/master/python/12-pdf-text.py
PDFから文字を抽出したい場合はこちら。(日本語未対応)
コンソールのデモだと10ページまでしか処理できないが、SDKからは11ページ以上処理可能。
SDK(boto3)
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/textract.html
Amazon Transcribe
2020/7/9現在
バッチでの書き起こしは日本語対応している。
ストリーミング処理は、日本語非対応で、東京リージョンも非対応。
https://aws.amazon.com/jp/about-aws/global-infrastructure/regional-product-services/
Amazon Translate
Amazon Lookout for Equipment
ガスプラントなどに設置したセンサーデータをもとに時系列異常検知を行い、通知するサービス
【公式】開発者ドキュメント
https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/what-is.html
【公式】GitHub
https://github.com/aws-samples/amazon-lookout-for-equipment
【公式】GitHub
https://github.com/aws-samples/lookout-for-equipment-demo
AWS re:Invent 2020: Detect abnormal equipment behavior by analyzing sensor data
https://www.youtube.com/watch?v=G8Z1Bt2kBtY
DeepRacer
AWS DeepRacerリーグに個人参加して入賞、上位をキープし続けている手法
https://pages.awscloud.com/rs/112-TZM-766/images/G-7.pdf