{"id":9025,"date":"2021-04-26T07:00:59","date_gmt":"2021-04-25T22:00:59","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=9025"},"modified":"2021-04-25T02:18:26","modified_gmt":"2021-04-24T17:18:26","slug":"laravel-amazon-comprehend-%e3%81%a7%e5%be%93%e6%a5%ad%e5%93%a1%e3%81%ae%e6%84%9f%e6%83%85%e3%82%92%e6%97%a5%e5%a0%b1%e3%81%8b%e3%82%89%e5%88%a4%e5%88%a5%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=9025","title":{"rendered":"Laravel + Amazon Comprehend \u3067\u5f93\u696d\u54e1\u306e\u611f\u60c5\u3092\u65e5\u5831\u304b\u3089\u5224\u5225\u3059\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u3068\u3053\u308d<code>AWS<\/code>\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u3044\u308d\u3044\u308d\u3068\u4f53\u9a13\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u4eca\u56de\u3082\u305d\u306e\u6d41\u308c\u3067\u300c<strong>\u3042\u308b\u3053\u3068<\/strong>\u300d\u3092\u5b9f\u88c5\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u6587\u7ae0\u304b\u3089\u611f\u60c5\u3092\u8aad\u307f\u53d6\u308b<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u308c\u3092\u5b9f\u73fe\u3067\u304d\u308b<code>Amazon Comprehend<\/code>\u3067\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u5f93\u696d\u54e1\u306e\u611f\u60c5\u3092\u65e5\u5831\u304b\u3089\u5224\u5225\u3059\u308b<\/strong><\/p>\n<p>\u3059\u308b\u3068\u3044\u3046\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u76ee\u7684\u3068\u3057\u3066\u306f\u3001\u300c<strong>\u5f93\u696d\u3055\u3093\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5fc5\u8981\u304b\u3069\u3046\u304b\u3092\u6570\u5024\u5316\u3059\u308b<\/strong>\u300d\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u3069\u306e\u4e16\u754c\u3067\u3082\u300c\u77e5\u3089\u306a\u3044\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u300d\u3068\u3044\u3046\u306e\u306f\u5f53\u7136\u306e\u3053\u3068\u3067\u3059\u304c\u3001\u3084\u306f\u308a\u81ea\u5206\u304b\u3089\u30d8\u30eb\u30d7\u30fb\u30b5\u30a4\u30f3\u3092\u51fa\u305b\u306a\u3044\u4eba\u304c\uff08\u7279\u306b\u65e5\u672c\u4eba\u306b\u306f\uff09\u591a\u3044\u3088\u3046\u306b\u611f\u3058\u307e\u3059\u306e\u3067\u3001\u304d\u3063\u3068<code>Amazon Comprehend<\/code>\u306f\u3053\u3046\u3044\u3063\u305f\u5206\u91ce\u3067\u3082\u5f79\u306b\u7acb\u3064\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u8003\u3048\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u3082\u697d\u3057\u304f\u30d7\u30ed\u30b0\u30e9\u30e0\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/>\u300c\u3069\u3046\u3084\u3089\u5343\u9ce5\u6e29\u6cc9\u306e<br \/>\n\u93e1\u5e83\u544a\u3001\u4eba\u6c17\u3059\u304e\u3066<br \/>\n\u5e74\u5185\u306f\u30e0\u30ea\u307f\u305f\u3044\u3067\u3059\u3002\ud83d\ude2d\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 8.x\u3001Amazon Comprehend\uff08\u30d0\u30fc\u30b8\u30e7\u30f3\uff1a2017-11-27\uff09<\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p><code>Laravel<\/code>\u306b\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3067\u3042\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<br \/>\n\u3082\u3057\u307e\u3060\u306e\u65b9\u306f\u4ee5\u4e0b\u304b\u3089\u5148\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\ud83d\udcdd<strong> \u53c2\u8003URL<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=8301\">Laravel Breeze\u3067\u300c\u30b7\u30f3\u30d7\u30eb\u306a\u300d\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=7827\">Laravel8.x\u4ee5\u964d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<\/ul>\n<p>\u203b\u306a\u304a\u3001<code>Jetstream<\/code>\u306f\u9ad8\u6a5f\u80fd\u3067\u3059\u304c\u6539\u9020\u304c\u96e3\u3057\u3044\u306e\u3067\u3001<code>Laravel Breeze<\/code>\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\ud83d\udc4d<\/p>\n<h1><span id=\"IAM\">AWS\u3078\u306e\u30a2\u30af\u30bb\u30b9\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b<\/span><\/h1>\n<p>\u307e\u305a<code>Laravel<\/code>\u304b\u3089<code>Amazon Comprehend<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u306f<code>AWS<\/code>\u306e\u300c<strong>IAM<\/strong>\u300d\u3067\u53d6\u5f97\u3067\u304d\u308b\u4ee5\u4e0b\uff12\u3064\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30a2\u30af\u30bb\u30b9\u30ad\u30fc<\/li>\n<li>\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30a2\u30af\u30bb\u30b9\u30ad\u30fc<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u3053\u306e\u4f5c\u696d\u306f\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306b\u3057\u3066\u53d6\u5f97\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a<\/strong>\u00a0<a href=\"https:\/\/blog.capilano-fw.com\/?p=8890#IAM\" target=\"_blank\" rel=\"noopener\">\u30a2\u30af\u30bb\u30b9\u60c5\u5831\uff08IAM\uff09\u3092\u53d6\u5f97\u3059\u308b<\/a><\/p>\n<p>\u306a\u304a\u3001\u30a2\u30af\u30bb\u30b9\u6a29\u9650\u306f\u300c<strong>ComprehendFullAccess<\/strong>\u300d\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9042\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_1.png\" alt=\"\" width=\"416\" height=\"411\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_1.png 416w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_1-300x296.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_1-100x100.png 100w\" sizes=\"auto, (max-width: 416px) 100vw, 416px\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u53d6\u5f97\u3067\u304d\u305f\u3089<code>.env<\/code>\u306b\u30bb\u30c3\u30c8\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>.env<\/strong><\/p>\n<pre class=\"hljs ini\"><strong><span class=\"hljs-attr\">AWS_ACCESS_KEY_ID<\/span>=<span class=\"hljs-string\">\"\uff08\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\uff09\"<\/span><\/strong>\r\n<strong><span class=\"hljs-attr\">AWS_SECRET_ACCESS_KEY<\/span>=<span class=\"hljs-string\">\"\uff08\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\uff09\"<\/span><\/strong>\r\n<strong><span class=\"hljs-attr\">AWS_DEFAULT_REGION<\/span>=ap-northeast-<span class=\"hljs-number\">1<\/span><\/strong><\/pre>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p><code>AWS<\/code>\u306f<code>PHP<\/code>\u7528\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u63d0\u4f9b\u3057\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"hljs coffeescript\"><strong>composer <span class=\"hljs-built_in\">require<\/span> aws\/aws-sdk-php<\/strong><\/pre>\n<h1>\u696d\u52d9\u65e5\u5831\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001<code>Laravel<\/code>\u3067\u30b7\u30f3\u30d7\u30eb\u306a\u300c<strong>\u696d\u52d9\u65e5\u5831\u30b7\u30b9\u30c6\u30e0<\/strong>\u300d\u3092\u4f5c\u308a\u307e\u3059\u3002\uff08\u3053\u306e\u90e8\u5206\u306f\u30e1\u30a4\u30f3\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u6295\u7a3f\u3060\u3051\u3067\u304d\u308b\u3088\u3046\u3057\u307e\u3059\uff09<\/p>\n<h2>\u30e2\u30c7\u30eb + \u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u4eca\u56de\u5fc5\u8981\u306a\u300c<strong>\u30e2\u30c7\u30eb + \u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong>\u300d\u3092\uff12\u30da\u30a2\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>work_reports\uff1a \u65e5\u5831\u306e\u30e1\u30a4\u30f3\u30c6\u30fc\u30d6\u30eb<\/li>\n<li>work_report_sentiments\uff1a \u611f\u60c5\u5206\u6790\u3057\u305f\u7d50\u679c\u306e\u30c6\u30fc\u30d6\u30eb<\/li>\n<\/ul>\n<p>\u203b\u3064\u307e\u308a\u3001<code>work_reports<\/code> \uff1a\u00a0<code>work_report_sentiments<\/code> \u306f\u300c<strong>1\uff1a\u591a<\/strong>\u300d\u306e\u95a2\u4fc2\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model WorkReport -m\r\nphp artisan make:model WorkReportSentiment -m\r\n<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u305d\u308c\u305e\u308c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>database\/migrations\/****_**_**_******_create_work_reports_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('work_reports', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('user_id')-&gt;comment('\u30e6\u30fc\u30b6\u30fcID');<\/strong>\r\n<strong>        $table-&gt;text('description')-&gt;comment('\u5185\u5bb9');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n\r\n<strong>        $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users');<\/strong>\r\n<strong>    });<\/strong>\r\n}<\/pre>\n<p><strong>database\/migrations\/****_**_**_******_create_work_report_sentiments_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('work_report_sentiments', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('work_report_id')-&gt;comment('\u65e5\u5831\u306eID');<\/strong>\r\n<strong>        $table-&gt;string('type')-&gt;comment('\u611f\u60c5\u30bf\u30a4\u30d7'); \/\/ POSITIVE, NEUTRAL, MIXED, or NEGATIVE<\/strong>\r\n<strong>        $table-&gt;unsignedTinyInteger('score')-&gt;comment('\u611f\u60c5\u306e\u5ea6\u5408\u3044'); \/\/ \u7ba1\u7406\u3057\u3084\u3059\u3044\u306e\u3067 0\u301c100 \u3067\u7ba1\u7406\u3057\u307e\u3059<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n\r\n<strong>        $table-&gt;foreign('work_report_id')-&gt;references('id')-&gt;on('work_reports');<\/strong>\r\n<strong>    });<\/strong>\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30e2\u30c7\u30eb\u306b\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Models\/WorkReport.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Models;\r\n\r\nuse App\\Events\\WorkReportSaved;\r\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass WorkReport extends Model\r\n{\r\n    use HasFactory;\r\n\r\n    <strong>\/\/ Relationship<\/strong>\r\n<strong>    public function sentiments()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return $this-&gt;hasMany(WorkReportSentiment::class, 'work_report_id', 'id');<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function user() {<\/strong>\r\n\r\n<strong>        return $this-&gt;belongsTo(User::class, 'user_id', 'id');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u5909\u66f4\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30c6\u30fc\u30d6\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9028\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_2.png\" alt=\"\" width=\"350\" height=\"252\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_2.png 350w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_2-300x216.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9029\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_3.png\" alt=\"\" width=\"403\" height=\"272\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_3.png 403w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_3-300x202.png 300w\" sizes=\"auto, (max-width: 403px) 100vw, 403px\" \/><\/p>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h2>\n<p>\u6b21\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller WorkReportController<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Http\/Controllers\/WorkReportController.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\n<strong>use App\\Models\\WorkReport;<\/strong>\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass WorkReportController extends Controller\r\n{\r\n    <strong>public function create()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return view('user.work_report.create');<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function store(Request $request)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        \/\/ [\u3054\u6ce8\u610f] \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u7701\u7565\u3057\u3066\u307e\u3059<\/strong>\r\n\r\n<strong>        $word_report = new WorkReport();<\/strong>\r\n<strong>        $word_report-&gt;user_id = auth()-&gt;id();<\/strong>\r\n<strong>        $word_report-&gt;description = $request-&gt;description;<\/strong>\r\n<strong>        $result = $word_report-&gt;save();<\/strong>\r\n\r\n<strong>        return ['result' =&gt; $result];<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<h2>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u5148\u307b\u3069\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u5185\u3067\u30bb\u30c3\u30c8\u3057\u305f\u30d3\u30e5\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><strong>resources\/views\/user\/work_report\/create.blade.php<\/strong><\/p>\n<pre><strong>&lt;html&gt;<\/strong>\r\n<strong>&lt;head&gt;<\/strong>\r\n<strong>    &lt;link href=\"https:\/\/unpkg.com\/tailwindcss@^2\/dist\/tailwind.min.css\" rel=\"stylesheet\"&gt;<\/strong>\r\n<strong>&lt;\/head&gt;<\/strong>\r\n<strong>&lt;body&gt;<\/strong>\r\n<strong>&lt;div id=\"app\" class=\"py-5 container mx-auto\"&gt;<\/strong>\r\n<strong>    &lt;div class=\"text-center text-3xl font-bold mb-3\"&gt;<\/strong>\r\n<strong>        \u696d\u52d9\u5831\u544a<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>    &lt;div class=\"bg-gray-200 p-2\"&gt;\u696d\u52d9\u5831\u544a&lt;\/div&gt;<\/strong>\r\n<strong>    &lt;div class=\"border-2\"&gt;<\/strong>\r\n<strong>        &lt;textarea class=\"p-2 w-full\" rows=\"10\" v-model=\"params.description\"&gt;&lt;\/textarea&gt;<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>    &lt;div class=\"text-right pt-5\"&gt;<\/strong>\r\n<strong>        &lt;button type=\"button\" class=\"bg-blue-700 text-blue-50 p-3 text-xl\" @click=\"onSubmit\"&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>&lt;\/div&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/unpkg.com\/vue@3.0.11\/dist\/vue.global.prod.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.21.1\/axios.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script&gt;<\/strong>\r\n\r\n<strong>    Vue.createApp({<\/strong>\r\n<strong>        data() {<\/strong>\r\n<strong>            return {<\/strong>\r\n<strong>                params: {<\/strong>\r\n<strong>                    description: ''<\/strong>\r\n<strong>                }<\/strong>\r\n<strong>            }<\/strong>\r\n<strong>        },<\/strong>\r\n<strong>        methods: {<\/strong>\r\n<strong>            onSubmit() {<\/strong>\r\n\r\n<strong>                if(confirm('\u9001\u4fe1\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f')) {<\/strong>\r\n\r\n<strong>                    const url = '{{ route('user.work_report.store') }}';<\/strong>\r\n<strong>                    axios.post(url, this.params)<\/strong>\r\n<strong>                        .then(response =&gt; {<\/strong>\r\n\r\n<strong>                            if(response.data.result === true) {<\/strong>\r\n\r\n<strong>                                alert('\u4fdd\u5b58\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002');<\/strong>\r\n<strong>                                this.params = {<\/strong>\r\n<strong>                                    description: '',<\/strong>\r\n<strong>                                };<\/strong>\r\n\r\n<strong>                            }<\/strong>\r\n\r\n<strong>                        });<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        }<\/strong>\r\n<strong>    }).mount('#app');<\/strong>\r\n\r\n<strong>&lt;\/script&gt;<\/strong>\r\n<strong>&lt;\/body&gt;<\/strong>\r\n<strong>&lt;\/html&gt;<\/strong><\/pre>\n<h2>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h2>\n<p>\u6700\u5f8c\u306b\u30eb\u30fc\u30c8\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre><strong>use App\\Http\\Controllers\\WorkReportController;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\n<strong>Route::prefix('user')-&gt;middleware('auth')-&gt;name('user.')-&gt;group(function() {<\/strong>\r\n\r\n<strong>    Route::resource('work_report', WorkReportController::class)-&gt;only([<\/strong>\r\n<strong>        'create',<\/strong>\r\n<strong>        'store'<\/strong>\r\n<strong>    ]);<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<h1>\u611f\u60c5\u5206\u6790\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u304c\u30e1\u30a4\u30f3\u306e<strong>\u65e5\u5831\u304b\u3089\u611f\u60c5\u5206\u6790\u3092\u3059\u308b\u90e8\u5206<\/strong>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6d41\u308c\u3068\u3057\u3066\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u65e5\u5831\u304c\u4fdd\u5b58\u3055\u308c\u308b<\/li>\n<li>\u30a4\u30d9\u30f3\u30c8\u3092\u81ea\u52d5\u7684\u306b\u8d77\u52d5\u3059\u308b<\/li>\n<li>\u30a4\u30d9\u30f3\u30c8\u5185\u3067AWS\u304b\u3089\u611f\u60c5\u5206\u6790\u7d50\u679c\u3092\u53d6\u5f97<\/li>\n<li>\u7d50\u679c\u3092\u4fdd\u5b58<\/li>\n<\/ul>\n<h2>\u30a4\u30d9\u30f3\u30c8\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u65e5\u5831\u304c\u4fdd\u5b58\u3055\u308c\u305f\u3089\u5fc5\u305a\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b<code>WorkReportSaved<\/code>\u30a4\u30d9\u30f3\u30c8\u3092\u3064\u304f\u3063\u3066\u30bb\u30c3\u30c8\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:event WorkReportSaved<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Events\/WorkReportSaved.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Events;\r\n\r\n<strong>use App\\Mail\\NegativeFeelingsDetected;<\/strong>\r\n<strong>use App\\Models\\WorkReport;<\/strong>\r\n<strong>use App\\Models\\WorkReportSentiment;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\nclass WorkReportSaved\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    <strong>public function __construct(WorkReport $work_report)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $client = new ComprehendClient([<\/strong>\r\n<strong>            'region' =&gt; 'ap-northeast-1', \/\/ \u6771\u4eac\u30ea\u30fc\u30b8\u30e7\u30f3<\/strong>\r\n<strong>            'version' =&gt; '2017-11-27'<\/strong>\r\n<strong>        ]);<\/strong>\r\n\r\n<strong>        try {<\/strong>\r\n\r\n<strong>            $text = $work_report-&gt;description;<\/strong>\r\n<strong>            $result = $client-&gt;detectSentiment([<\/strong>\r\n<strong>                'LanguageCode' =&gt; 'ja',<\/strong>\r\n<strong>                'Text' =&gt; $text \/\/ \u3053\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u611f\u60c5\u5206\u6790\u3059\u308b<\/strong>\r\n<strong>            ]);<\/strong>\r\n<strong>            $scores = $result['SentimentScore'];<\/strong>\r\n\r\n<strong>            foreach ($scores as $type =&gt; $score) {<\/strong>\r\n\r\n<strong>                $score = round($score * 100); \/\/ \u64cd\u4f5c\u3057\u3084\u3059\u3044\u3088\u3046\u306b 0\u301c100 \u3078\u5909\u63db<\/strong>\r\n<strong>                $sentiment = new WorkReportSentiment();<\/strong>\r\n<strong>                $sentiment-&gt;work_report_id = $work_report-&gt;id;<\/strong>\r\n<strong>                $sentiment-&gt;type = $type;<\/strong>\r\n<strong>                $sentiment-&gt;score = $score;<\/strong>\r\n<strong>                $sentiment-&gt;save();<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>        } catch (\\Exception $e) {<\/strong>\r\n\r\n<strong>            \/\/ \u3053\u3053\u306b\u3046\u307e\u304f\u3044\u304b\u306a\u304b\u3063\u305f\u3068\u304d\u306e\u51e6\u7406<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30a4\u30d9\u30f3\u30c8\u3092\u3064\u304f\u3063\u305f\u3060\u3051\u3067\u306f\u8d77\u52d5\u3055\u308c\u307e\u305b\u3093\u306e\u3067\u3001<code>WorkReport<\/code>\u30e2\u30c7\u30eb\u306b\u30bb\u30c3\u30c8\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><strong>app\/Models\/WorkReport.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\n\/\/ \u7701\u7565\r\n\r\nclass WorkReport extends Model\r\n{\r\n    use HasFactory;\r\n\r\n    <strong>protected $dispatchesEvents = [<\/strong>\r\n<strong>        'saved' =&gt; WorkReportSaved::class<\/strong>\r\n<strong>    ];<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001\u65e5\u5831\u304c\u4fdd\u5b58\uff08\u4f5c\u6210\u3001\u5909\u66f4\uff09\u3055\u308c\u305f\u3089\u81ea\u52d5\u7684\u306b<code>Amazon Comprehend<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u611f\u60c5\u5206\u6790\u306e\u7d50\u679c\u3092\u53d6\u5f97\uff06\u4fdd\u5b58\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<h1>\u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u611f\u60c5\u3092\u691c\u77e5\u3057\u305f\u3089\u7ba1\u7406\u8005\u3078\u901a\u77e5\u3059\u308b\u3088\u3046\u306b\u3059\u308b<\/h1>\n<p>\u305b\u3063\u304b\u304f\u611f\u60c5\u5206\u6790\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u3082\u3057\u65e5\u5831\u306e\u6587\u7ae0\u304b\u3089\u300c<strong>\u3053\u306e\u5f93\u696d\u54e1\u306f\u30b9\u30c8\u30ec\u30b9\u3092\u611f\u3058\u3066\u3044\u308b<\/strong>\u300d\u3068\u5224\u65ad\u3055\u308c\u305f\u3089\u3001\u7ba1\u7406\u8005\u3078\u30e1\u30fc\u30eb\u3067\u77e5\u3089\u305b\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u300c<strong>\u6295\u7a3f\u3057\u305f\u5f93\u696d\u54e1\u3055\u3093\u3078\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5fc5\u8981<\/strong>\u300d\u3067\u3042\u308b\u3068\u3044\u3046\u30a2\u30e9\u30fc\u30c8\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30e1\u30fc\u30eb\u90e8\u5206\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u611f\u60c5\u304c\u691c\u77e5\u3055\u308c\u305f\u3068\u304d\u306b\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b\u306a\u304a\u3001\u4eca\u56de\u306f\u3044\u3044\u6a5f\u4f1a\u3067\u3059\u306e\u3067<code>Markdown<\/code>\uff08\u2252\u7c21\u5358\u306bHTML\u8a18\u8ff0\u304c\u3067\u304d\u308b\u66f8\u304d\u65b9\uff09\u3092\u4f7f\u3063\u305f\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067<code>Mailable<\/code>\u30af\u30e9\u30b9\u3092\u3064\u304f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:mail NegativeFeelingsDetected --markdown=emails.negative_feelings_detected<\/strong><\/pre>\n<p>\u3059\u308b\u3068\uff08<code>Mailable<\/code>\u30af\u30e9\u30b9\u3068\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\uff09\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Mail\/NegativeFeelingsDetected.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Mail;\r\n\r\n<strong>use App\\Models\\WorkReport;<\/strong>\r\nuse Illuminate\\Bus\\Queueable;\r\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\r\nuse Illuminate\\Mail\\Mailable;\r\nuse Illuminate\\Queue\\SerializesModels;\r\n\r\nclass NegativeFeelingsDetected extends Mailable\r\n{\r\n    use Queueable, SerializesModels;\r\n\r\n    <strong>private $work_report, $score;<\/strong>\r\n\r\n<strong>    public function __construct(WorkReport $work_report, $score)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $this-&gt;work_report = $work_report;<\/strong>\r\n<strong>        $this-&gt;score = $score;<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function build()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $to = 'admin@example.com';<\/strong>\r\n<strong>        $from = 'no-reply@example.com';<\/strong>\r\n\r\n<strong>        return $this<\/strong>\r\n<strong>            -&gt;to($to)<\/strong>\r\n<strong>            -&gt;from($from)<\/strong>\r\n<strong>            -&gt;markdown('emails.negative_feelings_detected')<\/strong>\r\n<strong>            -&gt;with([<\/strong>\r\n<strong>                'work_report' =&gt; $this-&gt;work_report,<\/strong>\r\n<strong>                'score' =&gt; $this-&gt;score<\/strong>\r\n<strong>            ]);<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30e1\u30fc\u30eb\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff08Markdown\uff09\u3067\u3059\u3002<\/p>\n<p><strong>resources\/views\/emails\/negative_feelings_detected.blade.php<\/strong><\/p>\n<pre>@component('mail::message')\r\n# \u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u611f\u60c5\u3092\u691c\u77e5\r\n\r\n\u65e5\u5831\u304b\u3089\u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u611f\u60c5\u304c\u691c\u77e5\u3055\u308c\u307e\u3057\u305f\u3002\u5185\u5bb9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u5fc5\u8981\u3067\u3042\u308c\u3070\u30b5\u30dd\u30fc\u30c8\u3092\u5b9f\u65bd\u3057\u3066\u304f\u3060\u3055\u3044\u3002\r\n\r\n## \u5f93\u696d\u54e1\r\n\r\n```\r\n{{ $work_report-&gt;user-&gt;name }}\r\n```\r\n\r\n## \u65e5\u5831\u306e\u5185\u5bb9\r\n\r\n```\r\n{{ $work_report-&gt;description }}\r\n```\r\n\r\n## \u30cd\u30ac\u30c6\u30a3\u30d6\u6307\u6570\uff080 - 100\uff5c\u826f\u3044 - \u60aa\u3044\uff09\r\n\r\n```\r\n{{ $score }}\r\n```\r\n@endcomponent<\/pre>\n<p>\u203b\u306a\u304a\u3001<code>Markdown<\/code>\u306e\u66f8\u304d\u65b9\u306f<a href=\"https:\/\/guides.github.com\/features\/mastering-markdown\/\" target=\"_blank\" rel=\"noopener\">GitHub<\/a>\u304c\u307e\u3068\u3081\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u9001\u4fe1\u90e8\u5206\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u3064\u304f\u3063\u305f\u30e1\u30fc\u30eb\u3092\u5b9f\u969b\u306b\u9001\u4fe1\u3059\u308b\u90e8\u5206\u3067\u3059\u3002<br \/>\n\u3053\u308c\u306f\u3059\u3067\u306b\u4f5c\u6210\u3057\u305f\u30e2\u30c7\u30eb<code>WorkReportSaved<\/code>\u306e\u4e2d\u306b\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Events\/WorkReportSaved.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n$scores = $result['SentimentScore'];\r\n\r\nforeach ($scores as $type =&gt; $score) {\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n<strong>    if($type === 'Negative' &amp;&amp; $score &gt; 80) { \/\/ \u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u611f\u60c5\u3092\u691c\u77e5\u3057\u305f\u5834\u5408<\/strong>\r\n\r\n<strong>        \\Mail::send(new NegativeFeelingsDetected($work_report, $score));<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u5168\u3066\u5b8c\u4e86\u3067\u3059\uff01<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<br \/>\n<span style=\"font-size: 1rem;\">\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304b\u3089\u300c<\/span><strong style=\"font-size: 1rem;\">http:\/\/******\/user\/work_report\/create<\/strong><span style=\"font-size: 1rem;\">\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9030\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_4.png\" alt=\"\" width=\"640\" height=\"422\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_4.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_4-300x198.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u696d\u52d9\u5831\u544a\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30dd\u30b8\u30c6\u30a3\u30d6\u306a\u5185\u5bb9<\/h2>\n<p>\u3067\u306f\u3001\u306f\u3058\u3081\u306b\u4ee5\u4e0b\u306e\u30dd\u30b8\u30c6\u30a3\u30d6\u306a\u5185\u5bb9\u3092\u65e5\u5831\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>\u65b0\u30b7\u30b9\u30c6\u30e0\u306e\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\uff08\u901a\u5e38\u30ed\u30b0\u30a4\u30f3\uff0f\u30bd\u30fc\u30b7\u30e3\u30eb\u30ed\u30b0\u30a4\u30f3\uff09\u306e\u5b9f\u88c5\u304c\u4e88\u5b9a\u3088\u308a\u65e9\u304f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002\r\n\u30c6\u30b9\u30c8\u3082\u5b8c\u4e86\u3057\u3066\u304a\u308a\u3001\u30d0\u30b0\u306f\u767a\u898b\u3055\u308c\u3066\u304a\u308a\u307e\u305b\u3093\u3002\r\n\r\n\u307e\u305f\u3001\u682a\u5f0f\u4f1a\u793e\u5c71\u7530\u306e\u62c5\u5f53\u8005\u69d8\u304b\u3089\u300c\u7d20\u6674\u3089\u3057\u3044\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u300d\u3068\u304a\u8912\u3081\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002\r\n\r\n\u30af\u30ec\u30fc\u30e0\u767a\u751f\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/pre>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9033\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_8.png\" alt=\"\" width=\"542\" height=\"317\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_8.png 542w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_8-300x175.png 300w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/p>\n<p>\u307e\u305a<code>work_reports<\/code>\u30c6\u30fc\u30d6\u30eb\u30c7\u30fc\u30bf\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\u3067\u306f\u3001<strong>\u809d\u5fc3\u306e\u611f\u60c5\u5206\u6790\u306e\u65b9\u306f\u3069\u3046\u3067\u3057\u3087\u3046\u304b\u3002<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9032\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_6.png\" alt=\"\" width=\"538\" height=\"348\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_6.png 538w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_6-300x194.png 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u3046\u307e\u304f\u30c7\u30fc\u30bf\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code>Positive<\/code>\u304c93\u70b9\u306a\u306e\u3067<strong>\u611f\u60c5\u5206\u6790\u306e\u7d50\u679c\u3068\u3057\u3066\u3082\u6b63\u3057\u3044\u3068\u3044\u3063\u3066\u3044\u3044\u3067\u3057\u3087\u3046<\/strong>\u3002<\/p>\n<h2>\u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u5185\u5bb9<\/h2>\n<p>\u7d9a\u3044\u3066\u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u5185\u5bb9\u3082\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>\u65b0\u30b7\u30b9\u30c6\u30e0\u306e\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u306e\u958b\u767a\u53d6\u308a\u639b\u304b\u308a\u307e\u3057\u305f\u304c\u3001\u30bd\u30fc\u30b7\u30e3\u30eb\u30ed\u30b0\u30a4\u30f3\u306e\u4ed5\u69d8\u304c\u96e3\u3057\u304f\u3001\u307e\u3060\u5b9f\u969b\u306e\u4f5c\u696d\u306b\u5165\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\r\n\uff08\u3061\u306a\u307f\u306b\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u306f\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u3067\u3042\u3063\u3066\u3044\u308b\u306e\u304b\u306a\uff1f\u3068\u3044\u3046\u72b6\u614b\u3067\u3059\uff09\r\n\r\n\u307e\u305f\u3001\u682a\u5f0f\u4f1a\u793e\u4f50\u85e4\u306e\u62c5\u5f53\u8005\u69d8\u304b\u3089\u30d0\u30b0\u304c\u3042\u3063\u305f\u306e\u3067\u4fee\u6b63\u3057\u3066\u307b\u3057\u3044\u3068\u306e\u9023\u7d61\u304c\u306f\u3044\u308a\u307e\u3057\u305f\u3002\r\n\r\n\u30af\u30ec\u30fc\u30e0\u306f\uff13\u4ef6\u3042\u308a\u307e\u3057\u305f\u3002<\/pre>\n<p>\u7d50\u679c\u306f\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9034\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_7.png\" alt=\"\" width=\"541\" height=\"355\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_7.png 541w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_7-300x197.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\uff12\u3064\u76ee\u306e\u30c7\u30fc\u30bf\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u611f\u60c5\u5206\u6790\u7d50\u679c\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9035\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_9.png\" alt=\"\" width=\"537\" height=\"440\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_9.png 537w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_9-300x246.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/p>\n<p>\u3053\u3061\u3089\u3082\u304d\u3061\u3093\u3068\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3055\u308c\u307e\u3057\u305f\u304c\u3001<code>Negative<\/code>\u304c<code>85<\/code>\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3053\u306e\u5f93\u696d\u54e1\u3055\u3093\u306f\u300c<strong>\u30b9\u30c8\u30ec\u30b9\u3092\u611f\u3058\u3066\u3044\u308b<\/strong>\u300d\u3068\u3044\u3046\u5224\u65ad\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u60f3\u5b9a\u3057\u305f\u52d5\u304d\u3092\u3057\u3066\u3044\u307e\u3059\ud83d\ude0a<\/p>\n<p>\u305d\u3057\u3066\u3001\u4eca\u56de\u306f\u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u6570\u5024\u304c\u8a2d\u5b9a\u3055\u308c\u305f<code>80<\/code>\u3088\u308a\u3082\u5927\u304d\u304b\u3063\u305f\u306e\u3067\u901a\u77e5\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002\u3053\u3061\u3089\u3082\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9036\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_5.png\" alt=\"\" width=\"640\" height=\"289\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_5.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_5-300x135.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u901a\u77e5\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u5168\u3066\u6210\u529f\u3067\u3059\ud83d\ude0a\ud83d\udc4d\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u306f\u65e5\u5831\u3068\u3044\u3046\u5f62\u3067\u5f93\u696d\u54e1\u3055\u3093\u306e\u611f\u60c5\u5206\u6790\u3092\u8a66\u307f\u307e\u3057\u305f\u304c\u3001\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3055\u3048\u3042\u308c\u3070\u540c\u3058\u3053\u3068\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5fdc\u7528\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u53e3\u30b3\u30df\u306e\u66f8\u304d\u8fbc\u307f\u304b\u3089\u611f\u60c5\u3092\u5206\u6790\u3057\u3001\u5546\u54c1\u306e\u6539\u5584\u306b\u5f79\u7acb\u3066\u308b<\/li>\n<li>\u30e1\u30c3\u30bb\u30fc\u30b8\u30b5\u30fc\u30d3\u30b9\uff08\u4f8b\uff1a Slack\u3001ChatWork\u3001LINE\u306a\u3069\uff09\u3084\u30e1\u30fc\u30eb\u306e\u5185\u5bb9\u304b\u3089\u611f\u60c5\u5206\u6790\u3092\u3057\u3001\u30c1\u30fc\u30e0\u306e\u72b6\u614b\u3092\u628a\u63e1\u3059\u308b<\/li>\n<li>\u304a\u554f\u3044\u5408\u308f\u305b\u5185\u5bb9\u3092\u611f\u60c5\u5206\u6790\u3057\u3001\u3088\u308a\u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u3082\u306e\u306f\u30af\u30ec\u30fc\u30e0\u5bfe\u5fdc\u306b\u56de\u3059<\/li>\n<li>\u5165\u793e\u9762\u8ac7\u304c\u4e88\u5b9a\u3055\u308c\u3066\u3044\u308b\u4eba\u306eSNS\u3067\u611f\u60c5\u5206\u6790\u3057\u3001\u6027\u683c\u304c\u30dd\u30b8\u30c6\u30a3\u30d6\u306a\u306e\u304b\u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u306e\u304b\u3092\u5224\u65ad\u3059\u308b<\/li>\n<\/ul>\n<p>\u305c\u3072\u3054\u8208\u5473\u304c\u3042\u308a\u307e\u3057\u305f\u3089\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002m(_ _)m<\/p>\n<h1>\u3061\u306a\u307f\u306b\uff1a\u300c\u3071\u304a\u3093\u9000\u8077\u5c4a\u300d\u3067\u8a66\u3057\u3066\u307f\u305f<\/h1>\n<p>\u3075\u3068\u3001\u5c11\u3057\u524d\u306b\u8a71\u984c\u306b\u306a\u3063\u305f\u9000\u8077\u5c4a\u306e\u3053\u3068\u304c\u6c17\u306b\u306a\u3063\u305f\u306e\u3067<code>Amazon Comprehend<\/code>\u306f\u3069\u3046\u5224\u65ad\u3059\u308b\u306e\u304b\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>https:\/\/twitter.com\/matsukiyoippei\/status\/1360758126383755266<\/p>\n<p>\u7d50\u679c\u306f\u3053\u3061\u3089\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9040\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/04\/laravel_amazon_comprehend_10.png\" alt=\"\" width=\"121\" height=\"97\" \/><\/p>\n<p>\u3046\u3063\u3059\u3089<code>Positive<\/code>\u3060\u3068\u5224\u65ad\u3055\u308c\u3066\u3044\u307e\u3059\ud83d\ude02<br \/>\n\u9000\u8077\u3067\u304d\u3066\u5b09\u3057\u3044\u3068\u3044\u3046\u6c17\u6301\u3061\u306e\u73fe\u308c\u3067\u3057\u3087\u3046\u304b\u3002\u3002\u3002<\/p>\n<p>\u3053\u308c\u3092\u898b\u308b\u3068\u3001\u4eba\u9593\u306e\u611f\u60c5\u3063\u3066\u8907\u96d1\u3060\u3068\u611f\u3058\u307e\u3059\u306d\u3002<\/p>\n<h1>\u53c2\u8003\u306b\u3057\u305fURL<\/h1>\n<ul>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/aws-sdk-php\/v3\/api\/class-Aws.Comprehend.ComprehendClient.html\" target=\"_blank\" rel=\"noopener\">Class ComprehendClient<\/a><\/li>\n<\/ul>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f<code>Amazon Comprehend<\/code>\u3092\u4f7f\u3063\u3066\u611f\u60c5\u5206\u6790\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u304a\u3001\u7cbe\u5ea6\u306b\u95a2\u3057\u3066\u3067\u3059\u304c\u3001\u79c1\u306e\u500b\u4eba\u7684\u306aLINE\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u8a66\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u307b\u3068\u3093\u3069\u304c\u7d0d\u5f97\u3067\u304d\u308b\u5224\u5225\u7d50\u679c\u3068\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3072\u3068\u3064\u3060\u3051\u300c\u3046\u30fc\u3093\u3001\u305d\u308c\u306f\u30cd\u30ac\u30c6\u30a3\u30d6\u306b\u306f\u8a00\u3063\u3066\u306a\u3044\u306a&#8230;\ud83d\udca6\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u3063\u305f\u306e\u3082\u4e8b\u5b9f\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u5a49\u66f2\u7684\u306a\u8868\u73fe\u3084\u3001\u5b9f\u969b\u306e\u6c17\u6301\u3061\u3092\u30c6\u30ad\u30b9\u30c8\u306b\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u6d41\u77f3\u306b<code>Amazon<\/code>\u306e\u6a5f\u68b0\u5b66\u7fd2\u3067\u3082\u5224\u65ad\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u30c6\u30af\u30ce\u30ed\u30b8\u30fc\u306b\u983c\u308b\u3060\u3051\u3067\u306a\u304f\u3001<strong>\u300c\u65e5\u5831\u3092\u6b63\u76f4\u306b\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u300d\u3068\u3044\u3046\u3088\u3046\u306a\u8077\u5834\u74b0\u5883\u3082\u5fc5\u8981\u306b\u306a\u3063\u3066\u304f\u308b<\/strong>\u3068\u3044\u3063\u3066\u3044\u3044\u3067\u3057\u3087\u3046\u3002\uff08\u30d1\u30ef\u30cf\u30e9\u4e0a\u53f8\u304c\u3044\u305f\u3089\u7d76\u5bfe\u306b\u30a6\u30bd\u304c\u591a\u304f\u306a\u308a\u307e\u3059\u3088\u306d\uff09<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u306f\u3001\u307e\u3060\u307e\u3060\u30c7\u30fc\u30bf\u3060\u3051\u3067\u4f55\u304b\u3092\u5224\u65ad\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u3067\u306f\u3001\u30c6\u30b9\u30c8\u306a\u3089<code>AWS<\/code>\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3060\u3051\u3067\u611f\u60c5\u5206\u6790\u3092\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u7686\u3055\u3093\u3082\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3467 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png\" alt=\"\" width=\"216\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png 216w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9-203x300.png 203w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/>\u300c\u305d\u3046\u8003\u3048\u308b\u3068\u3001\u30d1\u30ef\u30cf\u30e9\u4e0a\u53f8\u30fb\u691c\u77e5\u30b7\u30b9\u30c6\u30e0<br \/>\n\u3068\u304b\u9700\u8981\u3042\u308b\u306e\u304b\u306a\uff1f\uff1f\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u3068\u3053\u308dAWS\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u3044\u308d\u3044\u308d\u3068\u4f53\u9a13\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u4eca\u56de\u3082\u305d\u306e\u6d41\u308c\u3067\u300c\u3042\u308b\u3053\u3068\u300d\u3092\u5b9f\u88c5\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 \u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb \u6587\u7ae0\u304b\u3089\u611f\u60c5\u3092\u8aad &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=9025\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + Amazon Comprehend \u3067\u5f93\u696d\u54e1\u306e\u611f\u60c5\u3092\u65e5\u5831\u304b\u3089\u5224\u5225\u3059\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":9049,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[233,3],"tags":[],"class_list":["post-9025","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aws","category-laravel"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9025","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9025"}],"version-history":[{"count":13,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9025\/revisions"}],"predecessor-version":[{"id":9052,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9025\/revisions\/9052"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/9049"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}