Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
wiki:software:beuthbot:deconcentrator-js [22.07.2020 19:02] Lukas Danckwerth |
wiki:software:beuthbot:deconcentrator-js [22.07.2020 19:20] (aktuell) Lukas Danckwerth [Requirements Analysis] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
===== Deconcentrator-JS ===== | ===== Deconcentrator-JS ===== | ||
- | [[http://php.net|{{https:// | + | [[https://raw.githubusercontent.com/ |
> BeuthBot deconcentrator written in JavaScript | > BeuthBot deconcentrator written in JavaScript | ||
Zeile 34: | Zeile 34: | ||
There are two different ways running the deconcentrator. First is with `Node.js`' | There are two different ways running the deconcentrator. First is with `Node.js`' | ||
- | = Install with npm = | + | == Install with npm == |
Using npm you simply type in the following command. | Using npm you simply type in the following command. | ||
< | < | ||
Zeile 46: | Zeile 46: | ||
This will run the deconcentrator on it's default port `8338` and with the default RASA service url `http:// | This will run the deconcentrator on it's default port `8338` and with the default RASA service url `http:// | ||
- | = Install with docker-compose.yml = | + | == Install with docker-compose.yml |
Using docker-compose is prossibly the easiest way of running the deconcentrator. Simply type | Using docker-compose is prossibly the easiest way of running the deconcentrator. Simply type | ||
Zeile 58: | Zeile 58: | ||
=== Structure === | === Structure === | ||
- | | Location | + | ^ Location |
- | | -------------------- | ----------------------------------------------------- | | + | |
| `.documentation/ | | `.documentation/ | ||
| `model/ | | `model/ | ||
Zeile 74: | Zeile 73: | ||
=== Functionality === | === Functionality === | ||
- |  request | ||
+ | activate RP | ||
+ | PQ -> P1: (async) request | ||
+ | activate P1 | ||
+ | RP -> PQ: interpretation | ||
+ | deactivate RP | ||
+ | PQ -> P2: (async) request | ||
+ | activate P2 | ||
+ | P1 -> PQ: interpretation | ||
+ | deactivate P1 | ||
+ | P2 -> PQ: interpretation | ||
+ | deactivate P2 | ||
+ | PQ -> DC: all\ninterpretations | ||
+ | deactivate PQ | ||
+ | DC -> DC: filter out\nbest intent | ||
+ | DC -> GW: response\nwith intent | ||
+ | deactivate DC | ||
+ | |||
+ | @enduml | ||
+ | </uml> | ||
== deconcentrator.js == | == deconcentrator.js == | ||
Zeile 89: | Zeile 127: | ||
== Implemented Processors == | == Implemented Processors == | ||
- | * [rasa-processor.js](model/rasa-processor.js) | + | * [[https:// |
* ... | * ... | ||
Zeile 122: | Zeile 160: | ||
</ | </ | ||
- | ### Request Schema - `Message` | + | === Request Schema - `Message` |
- | ```json | + | < |
{ | { | ||
" | " | ||
Zeile 130: | Zeile 168: | ||
" | " | ||
} | } | ||
- | ``` | + | </ |
Whereas the specification of the `min_confidence_score` and the`processors` is optional. If not minimum confidence score is given a default one is used (by now this is `0.8`). For now there is only the usage of RASA implemented so there is no effect of specifying the `processors` property. | Whereas the specification of the `min_confidence_score` and the`processors` is optional. If not minimum confidence score is given a default one is used (by now this is `0.8`). For now there is only the usage of RASA implemented so there is no effect of specifying the `processors` property. | ||
Zeile 136: | Zeile 174: | ||
== Class Diagramm == | == Class Diagramm == | ||
- | ![alternative | + | < |
+ | @startuml | ||
+ | |||
+ | class Message { | ||
+ | | ||
+ | min_confidence_score: Float | ||
+ | processors: Array< | ||
+ | } | ||
+ | |||
+ | @enduml | ||
+ | </uml> | ||
- | ### Response Schema - `Answer` | + | === Response Schema - `Answer` |
The response for a successfully processed request to the deconcentrator contains the following information. | The response for a successfully processed request to the deconcentrator contains the following information. | ||
< | < | ||
Zeile 182: | Zeile 230: | ||
== Class Diagramm == | == Class Diagramm == | ||
- | ![alternative | + | < |
+ | @startuml | ||
+ | |||
+ | class Answer { | ||
+ | | ||
+ | intent: Intent | ||
+ | entities: Array< | ||
+ | error: String | ||
+ | } | ||
+ | |||
+ | class Intent { | ||
+ | name: String | ||
+ | confidence: Float | ||
+ | } | ||
+ | |||
+ | class Entity { | ||
+ | start: Int | ||
+ | end: Int | ||
+ | text: String | ||
+ | value: String | ||
+ | confidence: Float | ||
+ | additional_info: | ||
+ | entity: String | ||
+ | } | ||
+ | |||
+ | class AdditionalInfo { | ||
+ | value: String | ||
+ | grain: String | ||
+ | type: String | ||
+ | values: Dictionary< | ||
+ | } | ||
+ | |||
+ | Answer *--- Intent | ||
+ | Answer *--- Entity | ||
+ | Entity *--- AdditionalInfo | ||
+ | |||
+ | @enduml | ||
+ | </uml> | ||
==== Implemented and connected NLU processors ==== | ==== Implemented and connected NLU processors ==== | ||
- | | Provider | + | ^ Provider |
- | | -------- |---------------- | -------------- | | + | | [[https:// |
- | | [RASA](https:// | + | |
=== More NLU processors candidates === | === More NLU processors candidates === | ||
- | - [Microsoft LUIS](https:// | + | * [[https:// |
- | - [Google Cloud NLU](https:// | + | * [[https:// |
- | - [IBM Watson | + | * [[https:// |
==== .env ==== | ==== .env ==== | ||
Zeile 211: | Zeile 295: | ||
==== Requirements Analysis ==== | ==== Requirements Analysis ==== | ||
- | * [x] `/DCF100/` The deconcentrator responds to incoming POST requests by delegating the message to a collection of NLU processor which try to interpretate the given message | + | * [x] '' |
- | * [x] `/DCF101/` The deconcentrator accepts incoming messages as defined via the Request Schema | + | * [x] '' |
- | * [x] `/DCF102/` The deconcentrator sends answers as defined via the Response Schema | + | * [x] '' |
- | * [x] `/DCF103/` The deconcentrator answers with proper messages for occuring errors | + | * [x] '' |
- | * [x] `/DCF104/` New NLU processors muss be easy to integrate | + | * [x] '' |
- | * [x] `/DCF105/` The deconcentrator has a default value for the minimum confidence score | + | * [x] '' |
- | * [x] `/DCF106/` The deconcentrator has a default value for the list of processors | + | * [x] '' |
- | * [x] `/DCF107/` The minimum confidence score can be set globally within the Dockerfile | + | * [x] '' |
- | * [ ] `/DCF108/` The list of processors to be used can be set globally within the Dockerfile | + | * [ ] '' |