├── doc └── source │ ├── dataset │ ├── .gitkeep │ ├── audio_sample.flac │ └── train_dataset.zip │ ├── images │ ├── .gitkeep │ ├── carros.png │ ├── arquitetura.png │ ├── THUMB-MBTC2020-DESAFIO8-BR.png │ └── THUMB-TUTORIAL-DESAFIO8-BR.png │ └── api.yaml ├── LICENSE └── README.md /doc/source/dataset/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/source/images/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/source/images/carros.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maratonadev-br/desafio-8-2020/HEAD/doc/source/images/carros.png -------------------------------------------------------------------------------- /doc/source/images/arquitetura.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maratonadev-br/desafio-8-2020/HEAD/doc/source/images/arquitetura.png -------------------------------------------------------------------------------- /doc/source/dataset/audio_sample.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maratonadev-br/desafio-8-2020/HEAD/doc/source/dataset/audio_sample.flac -------------------------------------------------------------------------------- /doc/source/dataset/train_dataset.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maratonadev-br/desafio-8-2020/HEAD/doc/source/dataset/train_dataset.zip -------------------------------------------------------------------------------- /doc/source/images/THUMB-MBTC2020-DESAFIO8-BR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maratonadev-br/desafio-8-2020/HEAD/doc/source/images/THUMB-MBTC2020-DESAFIO8-BR.png -------------------------------------------------------------------------------- /doc/source/images/THUMB-TUTORIAL-DESAFIO8-BR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maratonadev-br/desafio-8-2020/HEAD/doc/source/images/THUMB-TUTORIAL-DESAFIO8-BR.png -------------------------------------------------------------------------------- /doc/source/api.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | swagger: '2.0' 3 | info: 4 | description: 'API para análise de fala e recomendação de carros da FCA' 5 | version: '2.0.0' 6 | title: 'Desafio 8 - Maratona Behind the Code API' 7 | tags: 8 | - name: 'Recomendação' 9 | description: 'Análise de fala e recomendação de carro' 10 | schemes: 11 | - 'http' 12 | paths: 13 | /api/recommend: 14 | post: 15 | tags: 16 | - 'Recomendação' 17 | summary: 'Analisa críticas contidas em um arquivo de áudio ou em um texto e recomenda um carro da FCA dependendo das críticas.' 18 | description: '' 19 | consumes: 20 | - 'multipart/form-data' 21 | produces: 22 | - 'application/json' 23 | parameters: 24 | - name: 'car' 25 | in: 'formData' 26 | description: 'Nome do carro sobre o qual o comentário ou crítica é feito.' 27 | required: true 28 | type: 'string' 29 | - name: 'text' 30 | in: 'formData' 31 | description: 'Texto contendo uma crítica ou comentário sobre um carro.' 32 | required: false 33 | type: 'string' 34 | - name: 'audio' 35 | in: 'formData' 36 | description: 'Áudio em formato FLAC contendo uma crítica ou comentário sobre um carro.' 37 | required: false 38 | type: 'file' 39 | responses: 40 | 200: 41 | description: 'Operação sucedida' 42 | schema: 43 | $ref: '#/definitions/Result' 44 | definitions: 45 | Entity: 46 | type: 'object' 47 | properties: 48 | entity: 49 | type: 'string' 50 | example: 'desempenho' 51 | sentiment: 52 | type: 'number' 53 | example: -0.95 54 | mention: 55 | type: 'string' 56 | example: 'motor' 57 | Result: 58 | type: 'object' 59 | required: 60 | - 'entities' 61 | properties: 62 | recommendation: 63 | type: 'string' 64 | example: 'Fiat Argo' 65 | entities: 66 | type: 'array' 67 | items: 68 | $ref: '#/definitions/Entity' 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2020 Maratona Behind the Code 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![](https://img.shields.io/badge/IBM%20Cloud-powered-blue.svg)](https://cloud.ibm.com) 2 | 3 | chat on Discord 4 | 5 | # Desafio 08 | Fiat Chrysler Automobiles 6 | 7 | - [1. Sobre a FCA](#1-sobre-a-fca) 8 | - [1.1. Introdução](#11-introducao) 9 | - [1.2. Premiação](#12-premiacao) 10 | - [2. Desafio de negócio](#2-desafio-de-negócio) 11 | - [3. Objetivo](#3-objetivo) 12 | - [4. Tecnologias aplicadas](#4-tecnologias-aplicadas) 13 | - [5. Desenvolvimento](#5-desenvolvimento) 14 | - [5.1. Parte 1: Processamento de linguagem natural](#51-parte-1--processamento-de-linguagem-natural) 15 | - [5.2. Parte 2: Integração e deploy de uma API HTTP](#51-parte-2--integração-e-deploy-de-uma-api-http) 16 | - [6. Submissão](#6-submissão) 17 | - [7. Resumo das tarefas](#7-resumo-das-tarefas) 18 | - [8. Sobre a avaliação](#6-sobre-a-avaliação) 19 | 20 | ## Para te ajudar 21 | 22 | - [Material de Apoio](#material-de-apoio) 23 | - [License](#license) 24 | 25 | ## 1. Sobre a FCA 26 | 27 | ### 1.1. Introdução 28 | 29 | A Fiat Chrysler Automobiles (FCA) desenvolve, projeta, fabrica e comercializa automóveis, veículos comerciais leves, componentes e sistemas de produção. 30 | Com presença comercial em mais de 135 países, o Grupo opera 102 fábricas e 46 Centros de Pesquisa & Desenvolvimento no mundo. 31 | As marcas automotivas da FCA incluem Abarth, Alfa Romeo, Chrysler, Dodge, Fiat, Fiat Professional, Jeep, Lancia, Maserati e RAM. Os negócios do Grupo também incluem Mopar (peças e serviços automotivos), Comau (sistemas de produção) e Teksid (ferro e fundidos). 32 | O Grupo oferece ainda serviços financeiros em apoio ao varejo e concessionárias por meio de suas subsidiárias, joint ventures e acordos comerciais com instituições especializadas. 33 | No Brasil é uma empresa que fatura R\$ 46 bi e tem aproximadamente 24 mil funcionários. 34 | 35 |
36 | 37 | video-patrocinador 38 | 39 |
40 | 41 | ### 1.2. Premiação 42 | 43 |
44 | carros 45 |
46 | 47 | **Vencedor deste desafio** 48 | O vencedor deste desafio, com maior pontuação e que atenda aos critérios do regulamento da Maratona, ganhará do Grupo FCA **_01 veículo Fiat Argo Trekking 1.8 Flex Automático + Opcional Câmera de Ré 2020/2021_**. 49 | 50 | **Vencedor da Maratona Behind The Code** 51 | O primeiro lugar no ranking geral da Maratona, ganhará do Grupo FCA **_01 veículo Jeep Renegade Longitude AT 1.8 16V Flex 2020/2021_**. 52 | 53 | **Atenção**: A entrega dos prêmios não poderá ser cumulativa à mesma pessoa, ou seja, a pessoa ganhadora no ranking geral não poderá ser a mesma ganhadora do desafio do Grupo FCA. Nesta hipótese, o prêmio deste desafio será repassado à pessoa na segunda posição do desafio do Grupo FCA. 54 | 55 | ## 2. Desafio de negócio 56 | 57 | O Grupo FCA, em busca constante de melhoria de qualidade de seus serviços, bem como dar a melhor experiência para seus clientes, busca soluções tecnológicas, através do reconhecimento de voz, para capturar feedbacks e comentários de forma automática, e através de AI, analisar sentimento, e identificar partes relevantes do produto nesta experiência, como por exemplo, sobre motor, desempenho, acabamento, consumo, etc, e assim poder fazer recomendações e melhorar a experiência do usuário de forma evolutiva. Esta solução poderá ser utilizada durante a experiência de seus clientes, teste de engenharia e qualidade. 58 | 59 | ## 3. Objetivo 60 | 61 | Como objetivo principal, espera-se ter um dispositivo inteligente que é capaz de compreender sugestões de um motorista que dirige um veículo Fiat ou Jeep. Esse dispositivo será capaz de analisar o contexto do que está sendo dito em linguagem natural por um motorista, realizar análise de sentimento, e ao final ser capaz de sugerir outros veículos para test-drive ou review, além de sintetizar informações valiosas para equipes de engenharia responsáveis por melhorias nos automóveis. 62 | 63 | Neste desafio serão utilizados diversos serviços da IBM Cloud, como o Watson Speech to Text (STT) para a transcrição de áudio, e o Watson Natural Language Understanding (NLU) para extração de entidades textuais e análise de sentimento. As falas do motorista deverão ser processadas em áudio e texto, e as entidades textuais pertinentes a identificação de componentes, ou critérios de avaliação dos veículos, deverão ser anotadas por um modelo de IA. Esses serviços serão todos integrados por meio de um framework ou tecnologia de escolha livre pelo participante, que além do modelo treinado também entregará uma API REST como solução. 64 | 65 |
66 | video-tutorial 67 |
68 | 69 | ## 4. Tecnologias aplicadas 70 | 71 | Para este desafio serão utilizados os seguintes serviços da IBM Cloud: 72 | 73 | - [Watson Knowledge Studio](https://cloud.ibm.com/catalog/services/knowledge-studio) 74 | 75 | - [Watson Natural Language Understanding](https://cloud.ibm.com/catalog/services/natural-language-understanding) 76 | 77 | - [Watson Speech-to-Text](https://cloud.ibm.com/catalog/services/speech-to-text) 78 | 79 | Veja o vídeo-tutorial abaixo com dicas e instruções sobre como utilizar as principais tecnologias envolvidas: 80 | 81 |
82 | 83 | video-tutorial 84 | 85 |
86 | 87 | ## 5. Desenvolvimento 88 | 89 | O desafio da FCA consiste na criação de um serviço REST capaz de receber como parâmetro de entrada um áudio ou um texto e retornar uma sugestão de veículo e as entidades encontradas, bem como o sentimento associado a cada uma delas. O desafio é dividido então em duas partes principais: 90 | 91 | - Parte 1: Processamento de linguagem natural 92 | - Parte 2: Integração e deploy de uma API HTTP 93 | 94 | Leia as instruções abaixo com muita atenção para evitar erros na sua solução. 95 | 96 | ### 5.1. Parte 1: Processamento de linguagem natural 97 | 98 | Primeiramente você deverá criar um modelo anotador de linguagem natural no Watson Knowledge Studio para extrair entidades relacionadas aos veículos. Para tanto foi disponibilizado um [conjunto de documentos](./doc/source/dataset) que deverão ser anotados manualmente no WKS para a criação de seu modelo especializado. 99 | 100 | Seu modelo deve conter as seguintes **entidades** (esse conjunto de entidades é chamado de "Type System" no WKS): 101 | 102 |
103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 |
Nomes esperados para as entidades
ACESSORIOS
CONFORTO
CONSUMO
DESEMPENHO
DESIGN
MANUTENCAO
MODELO
SEGURANCA
136 |
137 | 138 | _Atenção aos nomes pois o validador buscará exatmente por essas entidades, da maneira como estão escritas acima._ 139 | 140 | Cada uma dessas entidades englobam aspectos relativos a veiculos automotores. Para tornar mais claro o que essas entidades representam segue a tabela abaixo com alguns exemplos de entidades e o trecho de texto que deve ser marcado. 141 | 142 |
143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 |
EntidadeExemplo de marcação
ACESSORIOSAr condicionado, Porta treco
CONFORTOBanco de couro, suspensão
CONSUMO10KM/L
DESEMPENHOMotor, arrancar
DESIGN4 portas
MANUTENCAOManutençao, mão de obra mecânica
MODELOFIAT Argo 1.8
SEGURANCAFreio
185 |
186 | 187 | Uma vez com os documentos marcados será necessário realizar o treinamento do modelo com base nas suas anotações manuais. Uma vez com o modelo treinado você deverá encapsulá-lo em uma instância do Natural Language Understanding (NLU). Todo o procedimento de marcação, encapsulamento e teste do seu modelo do WKS você econtra no [vídeo](#41-tecnologia-do-desafio) da seção acima. 188 | 189 | O NLU é um serviço que aceita somente texto como entrada, porém para esse desafio é esperado como entrada possível um arquivo de áudio, ou seja, será necessário fazer a transcrição do áudio para texto e em seguida utilizar o NLU e extrair as entidades. 190 | 191 | Portanto, o segundo passo no desenvolvimento da solução será a instanciação de um serviço de transcrição de áudio e integração de todas essas ferramentas de processamento de linguagem natural em uma API. 192 | 193 | ### 5.2. Parte 2: Integração e deploy de uma API HTTP 194 | 195 | Sua API deve ser capaz de receber um requisição `POST`, cujo conteúdo seja `mutipart/form-data` que receberá como entrada um aquivo de áudio no formato `FLAC` e um formulário indicando sobre qual carro é o comentário, ou um formulário com um texto e um carro a qual o texto se refere. 196 | 197 | Serão então duas possíveis entradas na API que será desenvolvida: 198 | 199 | - 1: Um arquivo de áudio em formato FLAC + uma string com o nome do veículo tratado; 200 | - 2: Uma string contendo comentários sobre um automóvel + outra string contendo o nome do veículo tratado. 201 | 202 | Abaixo segue um exemplo de como a requisição HTTP chegará no serviço desenvolvido quando o arquivo de áudio estiver presente: 203 | 204 | ```HTTP 205 | POST /NOME_DO_SEU_CAMINHO HTTP/1.1 206 | Host: ENDERECO_DO_SEU_HOST 207 | Content-Type: multipart/form-data; boundary=----WebKitFormBoundary8KJjbjbjHVHYY39 208 | 209 | ----WebKitFormBoundary8KJjbjbjHVHYY39 210 | Content-Disposition: form-data; name="car" 211 | 212 | uno 213 | ----WebKitFormBoundary8KJjbjbjHVHYY39 214 | Content-Disposition: form-data; name="audio"; filename="audio1.flac" 215 | Content-Type: multipart/form-data; 216 | 217 | (data) 218 | ----WebKitFormBoundary8KJjbjbjHVHYY39 219 | ``` 220 | 221 | Exemplo da requisição HTTP quando somente o formulário com texto e carro estiverem presentes: 222 | 223 | ```HTTP 224 | POST /NOME_DO_SEU_CAMINHO HTTP/1.1 225 | Host: ENDERECO_DO_SEU_HOST 226 | Content-Type: multipart/form-data; boundary=----WebKitFormBoundary721JSjgwfHG8RtH 227 | 228 | ----WebKitFormBoundary721JSjgwfHG8RtH 229 | Content-Disposition: form-data; name="car" 230 | 231 | uno 232 | ----WebKitFormBoundary721JSjgwfHG8RtH 233 | Content-Disposition: form-data; name="text" 234 | 235 | Carro bom carro legal 236 | ----WebKitFormBoundary721JSjgwfHG8RtH 237 | ``` 238 | 239 | Você deverá processar o áudio de entrada com o Watson STT (ou outro serviço de transcrição de sua preferência), e posteriormente processar o texto transcrito com o Watson NLU. 240 | 241 | Já a saída da sua API deve ser um documento JSON com a estrutura exemplo abaixo: 242 | 243 | ```JSON 244 | { 245 | "recommendation": "ARGO", 246 | "entities": [ 247 | { 248 | "entity": "ACESSORIOS", 249 | "sentiment": -0.890016, 250 | "mention": "Ar condicionado" 251 | }, 252 | { 253 | "entity": "CONSUMO", 254 | "sentiment": -0.001004, 255 | "mention": "8Km/L" 256 | } 257 | ] 258 | } 259 | ``` 260 | 261 | Caso seu modelo do NLU não encontre entidade nenhuma para fazer a analise necessária, sua API deve retornar um JSON no seguinte formato: 262 | 263 | ```JSON 264 | { 265 | "recommendation": "", 266 | "entities": [] 267 | } 268 | ``` 269 | 270 | A "recomendação" de veículo (variável `recommendation` na saída da API) deverá ser um dos seguintes valores tabelados abaixo (escritos exatamente como apresentados): 271 | 272 |
273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 |
Nomes esperados para os veículos recomendados
TORO
DUCATO
FIORINO
CRONOS
FIAT 500
MAREA
LINEA
ARGO
RENEGADE
309 |
310 | 311 | Além disso, a recomendação deve obedecer algumas regras: 312 | 313 | - Não deve haver recomendação de veículo se o sentimento geral identificado nas entidades reconhecidas pelo NLU for positivo; 314 | - O mesmo veículo passado no parâmetro de entrada não pode ser sugerido (ex: a API não pode recomendar o MAREA se o Marea for o carro trabalhado no review/comentário). 315 | - A recomendação do veículo deve ser baseda na entidade com sentimento mais negativo, por exemplo: O NLU extraiu duas entidades do tipo `DESEMPENHO` que no total possuem sentimento de -0.5 e uma do tipo `CONSUMO` com sentimento de -0.8, nesse caso a sugestão deve ser um carro com consumo melhor. 316 | - Em caso de empate no valor dos sentimentos ou caso a diferença absoluta entre os mais negativos seja menor que 0.1, a tebela de prioridades abaixo deve ser utilizada, onde a prioridade 1 é a mais prioritária e a 7 a menor. Por exemplo, o NLU extraiu uma entidade do tipo `SEGURANCA` que no total possuí sentimento de -0.6 e uma do tipo `CONSUMO` com sentimento de -0.65. Como a diferença absoluta entre elas é menor do que 0.1, deve ser sugerido um veículo com boa avaliação seguindo a tabela de prioridades. 317 | - O participante deverá escolher quais veículos se encaixam em cada prioridade, baseando-se nos exemplos de review fornecidos como conjunto de treino. 318 | 319 |
320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 |
PrioridadeEntidade
1SEGURANCA
2CONSUMO
3DESEMPENHO
4MANUTENCAO
5CONFORTO
6DESIGN
7ACESSORIOS
358 |
359 | 360 | A lógica de programação para a realização dessas tarefas é parte do desafio e deve ser implementada pelo participante. Na seção [Material de Apoio](#material-de-apoio) são apresentadas as referências de API dos serviços Watson STT e Watson NLU, que possuem exemplos e snippets de código em várias linguagens mostrando como utilizar os serviços da IBM Cloud diretamente com código. Neste repositório também se encontra a especificação da API desejada como solução (no padrão do Swagger, ou Open-API): [api.yaml](./doc/source/api.yaml). No dataset fornecido neste repositório também é dado um arquivo de áudio em formato FLAC para você testar sua API. 361 | 362 | Uma vez que você estiver confortável com sua solução, você precisará expor a API em alguma rota pública para que possamos testá-la. Recomendamos que você utilize a Cloud Foundry na IBM para hospedar sua aplicação, [aqui está um repositório com um exemplo](https://github.com/danitrod/cloud-foundry-example), e abaixo um vídeo de como realizar esse deploy: 363 | 364 |
365 | 366 | video-tutorial 367 | 368 |
369 | 370 | ## 6. Submissão 371 | 372 | Primeiramente, a submissão do **Desafio 8 - FCA** ficará disponível apenas na quarta-feira, dia 16 de setembro. Use o tempo disponível para implementar e testar bem sua solução, pois neste desafio só será permitida uma única chance válida. **Também não serão enviados e-mails de feedback com as estrelas**, apenas um alerta em caso de eventual falha na pontuação da sua submissão - assim como nos outros desafios, se ocorrer um erro no processo de pontuação, sua chance não é consumida e você pode submeter novamente. 373 | 374 | Para realizar a submissão você deverá acessar a seguinte página Web: [https://fca.maratona.dev](https://fca.maratona.dev) e preencher o formulário disponibilizado. Após clicar no botão `Submeter`, você deverá clicar no link de confirmação que será enviado via e-mail pela organização. 375 | 376 | ### 7. Resumo das tarefas 377 | 378 | 1. Baixar o conjunto de [amostras de texto fornecido](./doc/source/dataset) para treinamento do WKS. 379 | 2. Criar uma instância do Watson Knowledge Studio. 380 | 3. Criar uma instância do Natural Language Understanding. 381 | 4. Usar o WKS para criar um modelo de anotação textual especializado, utilizando o dataset disponibilizado. 382 | 5. Encapsular o modelo criado anteriormente com o Watson Natural Language Understanding. 383 | 6. Criar uma instância do serviço Watson Speech-to-Text (STT). 384 | 7. Construir uma API integrando o STT e o NLU, que seja capaz de receber audio ou texto como entrada, e devolver uma recomendação de veículo e as entidades textuais extraídas juntamente com o sentimento associado a cada uma delas. 385 | 8. Analisar e testar **bem** a sua solução com o conjunto de [amostras de texto](./doc/source/dataset) e [amostras de áudio](./doc/source/dataset) fornecidos. 386 | 9. Submeter sua solução em [https://fca.maratona.dev](https://fca.maratona.dev) - neste desafio você terá apenas 1 chance de submissão. 387 | 388 | ## 8. Sobre a avaliação 389 | 390 | O sistema testará se a sua API é capaz de realizar o processamento pedido e se a resposta dela está dentro do esperado, bem como se o seu modelo no NLU está extraindo as entidades corretamente e qual a confiança que ele tem nas extrações. Sua nota será uma função que relaciona a resposta da API com a confiaça das entidades extraídas diretamente no seu NLU. 391 | 392 | ## Material de apoio 393 | 394 | - [Watson Knowledge Studio Docs](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledge-studio-wks_tutintro) 395 | - [Natural Language Understanding Docs](https://cloud.ibm.com/docs/natural-language-understanding) 396 | - [Natural Language Understanding API REF](https://cloud.ibm.com/apidocs/natural-language-understanding) 397 | - [IBM Speech To Text Docs](https://cloud.ibm.com/docs/speech-to-text) 398 | - [IBM Speech To Text API REF](https://cloud.ibm.com/apidocs/speech-to-text) 399 | - [Aplicações Cloud Foundry na IBM Cloud](https://youtu.be/oUpqXxmr6oU) 400 | - [IBM Cloud Functions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-getting-started) 401 | 402 | Você também pode acessar o discord oficial da Maratona 2020 para realizar perguntas e/ou interagir com outros participantes: [Discord](https://discord.gg/2NRPpcU). 403 | 404 | ## License 405 | 406 | Copyright 2020 Maratona Behind the Code 407 | 408 | Licensed under the Apache License, Version 2.0 (the "License"); 409 | you may not use this file except in compliance with the License. 410 | You may obtain a copy of the License at 411 | 412 | http://www.apache.org/licenses/LICENSE-2.0 413 | 414 | Unless required by applicable law or agreed to in writing, software 415 | distributed under the License is distributed on an "AS IS" BASIS, 416 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 417 | See the License for the specific language governing permissions and 418 | limitations under the License. 419 | --------------------------------------------------------------------------------