Download???????????? ???????????? ????? NLP ???????? ??????????? ????????????
???? ? ?????? ?????????? ??????? ??? ?? Ascoos OS ?????? ?? ????????? ???????????? ????? ?????????? ???????? ??????????? ????????????. ???????????? ???????? NLP ??? ?? ????????? ?? ?????????? ??? ?? ???????? ??? ??????, ??? ??????????? macros ???? DSL script ??? ???????????? ?? AST.
??????
-
??????? ?????? ?? `TLanguageProcessingAIHandler`
-
?????????? ????????????? ??? ??????????????? ???????
-
??????? ??????? macro ???? DSL
-
????????? DSL ?? ??????????? ???????
-
???????? macros ???? ?????????? ?????????? ????????
?????? ??????? ??? Ascoos OS
-
TLanguageProcessingAIHandler
NLP ???????, ?????????? ??????? ??? ?????????????
-
AbstractDslAstBuilder
??????? DSL ?? AST ???????
-
AstMacroTranslator
????????? AST ?? ??????????? ????????? ??? ????????
???? ???????
? ?????? ??????????? ?? ??? ?????? PHP:
- semantic_macro_trigger.php
???????????? ??? ?? ??????: NLP ???????, DSL parsing, AST ????????? ??? ???????? ???????.
??????????????
-
PHP ? 8.2
-
????????????? ?? Ascoos OS ? ??
AWES
?????????? DSL
WHEN sentiment = negative AND topic = "economy" THEN
TAG "alert"
NOTIFY "Editor"
FLAG "Review"
??? ?????????
-
? `TLanguageProcessingAIHandler` ??????? ?? ?????.
-
?? ?????????? ???????? ?? `naiveBayesSentiment()`.
-
?? ??????? ??????????????? ?? `conceptActivationVector()`.
-
?? DSL ???????????? ?? AST ?? `AbstractDslAstBuilder`.
-
? `AstMacroTranslator` ???????????:
- `TAG` ? ???????? ????????
- `NOTIFY` ? ?????????? ????????
- `FLAG` ? ?????????? ??? ??????????
-
?? ??????? ??????????? ???? ?? ? ??????? ????? ??????.
?????????? ??????
$text = "...";
$nlp = new TLanguageProcessingAIHandler();
$sentiment = $nlp->naiveBayesSentiment($text);
$concepts = $nlp->conceptActivationVector([...], [$text]);
$dsl = <<<DSL
WHEN sentiment = negative AND topic = "economy" THEN
TAG "alert"
NOTIFY "Editor"
FLAG "Review"
DSL;
$astBuilder = new class extends AbstractDslAstBuilder {};
$ast = $astBuilder->buildAst($dsl);
$translator = new class([...]) extends AstMacroTranslator {};
$macroContainer = $translator->translateAst($ast);
$macroContainer->executeIfTrue();
??????????? ??????????
??? ?? ?????????? ????? ???????? ??? ? ???????? ????? "economy": ?? Tagged: alert
? Notification sent to: Editor
? Flagged for: Review
?????
??????????
???????? ?? ??????????? ?? DSL ?? ???? ???????, ?? ???????????? ???????? NLP ??????? ? ?? ???????????? ??? ????????? macro. ????? ?? CONTRIBUTING.md ??? ???????.
????? ??????
???? ? ?????? ?????????? ??? ??? Ascoos General License (AGL). ????? ?? LICENSE.md.
|