diff --git a/.gitignore b/.gitignore index 8d5aa23c..d61438e2 100644 --- a/.gitignore +++ b/.gitignore @@ -286,21 +286,9 @@ __pycache__/ *.btm.cs *.odx.cs *.xsd.cs -/App_Data -/Bot.WebStarter/App_Data/bot-rasa.db -/Bot.WebStarter/App_Data/DbInitializer/Agents/Dialogflow/VirtualAssistant -/BotSharp.WebStarter/App_Data/DbInitializer/Agents/Dialogflow/VirtualAssistant -/BotSharp.UnitTest/App_Data/DbInitializer/Agents -/BotSharp.UnitTest/App_Data/BotSharp.db /BotSharp.WebHost/App_Data/BotSharp.db /BotSharp.UI -/BotSharp.WebHost/App_Data/ModelFiles -/BotSharp.WebHost/App_Data/TrainingFiles -/BotSharp.WebHost/App_Data/PredictFiles /BotSharp.WebHost/App_Data/Projects /BotSharp.WebHost/PublishOutput /Data -/docs/build /docs/_build -/BotSharp.WebHost/App_Data/AgentArchive/Smart Niraj.zip -/BotSharp.NLP.UnitTest/wordvec_enu.bin diff --git a/BotSharp.UI/package-lock.json b/BotSharp.UI/package-lock.json index 180561de..0d286e99 100644 --- a/BotSharp.UI/package-lock.json +++ b/BotSharp.UI/package-lock.json @@ -3487,7 +3487,7 @@ "dev": true, "requires": { "boom": "2.x.x", - "cryptiles": "2.x.x", + "cryptiles": "~>4.1.2", "hoek": "2.x.x", "sntp": "1.x.x" } @@ -8726,7 +8726,7 @@ "integrity": "sha1-iSIN32t1GuUrX3JISGNShZa7hME=", "dev": true, "requires": { - "macaddress": "^0.2.8" + "macaddress": "~>0.2.9" } }, "uniqs": { diff --git a/Settings/swagger.json b/Settings/swagger.json index 8d3b771c..18f714be 100644 --- a/Settings/swagger.json +++ b/Settings/swagger.json @@ -2,7 +2,7 @@ "Swagger": { "Contact": { "Email": "haiping008@gmail.com", - "Name": "Haiping Chen", + "Name": "BotSharp AI", "Url": "https://github.com/Oceania2018" }, "Description": "BotSharp is a chatbot platform written in C# (.net core), and it's developed for enterprise usage.", diff --git a/docker-compose-articulateui.yml b/docker-compose-articulateui.yml index 3241d002..550b28b4 100644 --- a/docker-compose-articulateui.yml +++ b/docker-compose-articulateui.yml @@ -2,7 +2,7 @@ version: '3.0' services: api: - image: samtecspg/articulate-api:repo-head + image: samtecspg/articulate-api:0.12.1 ports: ['0.0.0.0:7500:7500'] networks: ['botsharp-network'] entrypoint: ['node', 'start.js'] @@ -10,7 +10,7 @@ services: - SWAGGER_BASE_PATH ui: - image: samtecspg/articulate-ui:repo-head + image: samtecspg/articulate-ui:0.12.1 ports: ['0.0.0.0:3000:3000'] networks: ['botsharp-network'] environment: @@ -21,10 +21,12 @@ services: image: botsharpdocker/botsharp:latest ports: ['0.0.0.0:5000:5000'] networks: ['botsharp-network'] + duckling: image: samtecspg/duckling:0.1.6.0 ports: ['0.0.0.0:8000:8000'] networks: ['botsharp-network'] + redis: image: redis:4.0.6-alpine ports: ['0.0.0.0:6379:6379'] diff --git a/docs/agent/import-agent.rst b/docs/agent/import-agent.rst new file mode 100644 index 00000000..98c5c599 --- /dev/null +++ b/docs/agent/import-agent.rst @@ -0,0 +1,45 @@ +Import Agent +============ +Designed as a multi-platform framework, BotSharp allows developers to create their own Bot platforms and support multiple Bot platform services. It supports multiple Bot import, export and message reply formats such as Dialogflow and Rasa. +Support for importing and exporting between platforms. + +**First, export agent from other chatbot platform.** + +In general, the platform provides the ability to export to a compressed file. Different platform has different export method. + +**Second, add meta.json to zip file.** + +meta.json is used to tell BotSharp where the agent is exported from. It should looks like below: + +.. code-block:: json + + { + "Id": "YOURS", + "Name": "YOURS", + "Platform": "Dialogflow", + "ClientAccessToken": "YOURS", + "DeveloperAccessToken": "YOURS", + "Integrations": [] + } + +Extract zip file and add the meta.json to the zip file. + +1. Google Dialogflow +:: + +"Platform": "Dialogflow" + +2. RASA +:: + +"Platform": "Rasa" + +3. Microsoft LUIS + +**Last, upload updated zip file.** + +Upload zip file in REST API. + +|RestoreAgentFromZipScreenshot| + +.. |RestoreAgentFromZipScreenshot| image:: /static/screenshots/RestoreAgentFromZip.png \ No newline at end of file diff --git a/docs/agent/optimize-agent.rst b/docs/agent/optimize-agent.rst new file mode 100644 index 00000000..16ebbf11 --- /dev/null +++ b/docs/agent/optimize-agent.rst @@ -0,0 +1,4 @@ +Optimized Robot +=============== + +The semantic understanding ability of the robot can be improved by modifying the parameters of the training and the selection of the hyperparameters. \ No newline at end of file diff --git a/docs/agent/test-agent.rst b/docs/agent/test-agent.rst new file mode 100644 index 00000000..b478ceab --- /dev/null +++ b/docs/agent/test-agent.rst @@ -0,0 +1,13 @@ +Test Agent +=========== + +After the training is complete, you can start testing the Agent. Enter the robot name and the statement you want to test. + +|APITestInputScreenshot| + +After clicking the execution, you will get the result returned by the server, which contains the user intent and the entity value. + +|APITestResultScreenshot| + +.. |APITestInputScreenshot| image:: /static/screenshots/APITestInput.png +.. |APITestResultScreenshot| image:: /static/screenshots/APITestResult.png \ No newline at end of file diff --git a/docs/agent/train-agent.rst b/docs/agent/train-agent.rst new file mode 100644 index 00000000..f0b0a302 --- /dev/null +++ b/docs/agent/train-agent.rst @@ -0,0 +1,20 @@ +Train Agent +=========== + +When you successfully import the Agent, the next step is to train your Agent and let it run according to your pre-designed process. + +Fill in your Agent name and click the "Train" button for a while (depending on the size of the data). + +|APITrainStartScreenshot| + +During the training, the console will enter the training status immediately. + +|APITrainInProgressScreenshot| + +After the training is completed, you will get the details of a model. + +|APITrainCompletedScreenshot| + +.. |APITrainStartScreenshot| image:: /static/screenshots/APITrainStart.png +.. |APITrainInProgressScreenshot| image:: /static/screenshots/APITrainInProgress.png +.. |APITrainCompletedScreenshot| image:: /static/screenshots/APITrainCompleted.png \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index b77b0a23..3c645669 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -101,7 +101,7 @@ html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ['static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. diff --git a/docs/index.rst b/docs/index.rst index 5bdb3395..987649cd 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,12 +6,12 @@ .. image:: https://raw.githubusercontent.com/Oceania2018/BotSharp/master/BotSharp.WebHost/wwwroot/images/BotSharp.png :height: 30px -The Open Source AI Bot Platform Builder for Enterprise +The Open Source AI Bot Platform Builder ====================================================== -*"Conversation as a platform (CaaP) is the future, so it's perfect that we're already offering the whole toolkits to our enterprise developers using the BotSharp Bot Platform Builder to build a CaaP. It opens up as much learning power as possible for your enterprise robots and precisely control every step of the AI processing pipeline."* +*"Conversation as a platform (CaaP) is the future, so it's perfect that we're already offering the whole toolkits to .NET developers using the BotSharp Bot Platform Builder to build a CaaP. It opens up as much learning power as possible for your robots and precisely control every step of the AI processing pipeline."* -**BotSharp** is an open source machine learning framework for AI Bot platform builder. This project involves natural language understanding, computer vision and audio processing technologies, and aims to promote the development and application of intelligent robot assistants in enterprise information systems. Out-of-the-box machine learning algorithms allow ordinary programmers to develop artificial intelligence applications faster and easier. +**BotSharp** is an open source machine learning framework for AI Bot platform builder. This project involves natural language understanding, computer vision and audio processing technologies, and aims to promote the development and application of intelligent robot assistants in information systems. Out-of-the-box machine learning algorithms allow ordinary programmers to develop artificial intelligence applications faster and easier. It's witten in C# running on .Net Core that is full cross-platform framework. C# is a enterprise grade programming language which is widely used to code business logic in information management related system. More friendly to corporate developers. BotSharp adopts machine learning algrithm in C/C++ interfaces directly which skips the python interfaces. That will facilitate the feature of the typed language C#, and be more easier when refactoring code in system scope. @@ -22,13 +22,16 @@ BotSharp is in accordance with components princple strictly, decouples every par Some Features ------------- +* Integrated debugging is easier without relying on any other machine learning algorithm libraries. * Built-in multi-Agents management, easy to build Bot as a Service platform. * Context In/ Out with lifespan to make conversion flow be controllable. -* Use the natural language processing pipeline mechanism and the popular NLP algorithm library to build your own unique robot processing flow. +* Use the natural language processing pipeline mechanism to work with extensions easily, and build your own unique robot processing flows. +* Rewrote NLP algorithm from ground without historical issues. * Support export/ import agent from other bot platforms directly. * Support different UI providers like `Rasa UI`_ and `Articulate UI`_. * Support for multiple data request and response formats such as Rasa NLU and Dialogflow. * Integrate with popular social platforms like Facebook Messenger, Slack and Telegram. +* Multi-core parallel computing optimization, High-Performance C# on GPUs in Hybridizer. Indices and tables ================== @@ -36,6 +39,7 @@ The main documentation for the site is organized into a couple sections: * :ref:`User Documentation ` * :ref:`Integration Documentation ` +* :ref:`NLP Documentation ` * :ref:`search` .. _user-docs: @@ -45,16 +49,36 @@ The main documentation for the site is organized into a couple sections: :caption: User Documentation: installation + agent/import-agent + agent/train-agent + agent/test-agent + agent/optimize-agent .. _integration-docs: .. toctree:: - :maxdepth: 2 - :caption: Integration Documentation: + :maxdepth: 3 + :caption: Channels Integration Documentation: integrations/facebook-messenger + integrations/slack + integrations/telegram + integrations/skype -If you feel that this project is helpful to you, please Star on the project, we will be very grateful. +.. _nlp-docs: + +.. toctree:: + :maxdepth: 2 + :caption: NLP Documentation: + + models/crf + models/nb + models/ngram + models/svm + models/tfidf + models/penntreebank + +If you feel that this project is helpful to you, please Star us on the project, we will be very grateful. .. _Rasa UI: https://github.com/paschmann/rasa-ui .. _Articulate UI: https://spg.ai/projects/articulate diff --git a/docs/installation.rst b/docs/installation.rst index d214fa3b..b604f964 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -2,7 +2,7 @@ Installation ============ BotSharp strictly follows the modular design principle and adopts a structure in which views and logic are separated. So you can choose the front-end Bot design and management interface. -If you want to use the `RASA UI`_ as a front end, you can use the rasaui-specific compose file to quickly experience BotSharp. +If you want to use the `Articulate UI`_ as a front end, you can use the articulateui-specific compose file to quickly experience BotSharp. Docker Composer ^^^^^^^^^^^^^^^ @@ -20,6 +20,7 @@ You can use docker compose to run, make sure you've got `Docker`_ installed. PS D:\BotSharp\> docker-compose -f docker-compose-articulateui.yml up Point your web browser at http://localhost:3000 and enjoy Articulate-UI with BotSharp. +|ArticulateHomeScreenshot| 2. Integrate with `Rasa UI`_, you can use docker compose to run. @@ -29,8 +30,14 @@ Point your web browser at http://localhost:3000 and enjoy Articulate-UI with Bot Point your web browser at http://localhost:5001 and enjoy Rasa-UI with BotSharp. +|RasaUIHomeScreenshot| + +3. Integrate with `Rasa Talk`_ + + Building BotSharp ^^^^^^^^^^^^^^^^^ +If you are a .NET developer and want to develop extensions or fix bug for BotSharp, you would CTRL + F5 to run it locally in debug mode. Make sure the `Microsoft .NET Core`_ build environment is installed. Building solution using dotnet CLI (preferred). @@ -43,6 +50,8 @@ Building solution using dotnet CLI (preferred). Install in docker container ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +If you just want to run BotSharp as a backend NLU engine, you can run it standalone in docker. + :: PS D:\> git clone https://github.com/Oceania2018/BotSharp @@ -61,7 +70,9 @@ Start a container: PS D:\BotSharp\> docker run -it -p 5000:5000 botsharp +Access restful APIs: http://localhost:5000 if you are using RASA response format. +|APIHomeScreenshot| Install in NuGet @@ -81,5 +92,10 @@ Use BotSharp.NLP as a natural language processing toolkit alone. .. _Rasa UI: https://github.com/paschmann/rasa-ui .. _Articulate UI: https://spg.ai/projects/articulate +.. _Rasa Talk: https://github.com/jackdh/RasaTalk .. _Microsoft .NET Core: https://www.microsoft.com/net/download -.. _Docker: https://www.docker.com \ No newline at end of file +.. _Docker: https://www.docker.com + +.. |APIHomeScreenshot| image:: /static/screenshots/APIHome.png +.. |ArticulateHomeScreenshot| image:: /static/screenshots/ArticulateHome.png +.. |RasaUIHomeScreenshot| image:: /static/screenshots/RasaUIHome.png \ No newline at end of file diff --git a/docs/integrations/skype.rst b/docs/integrations/skype.rst new file mode 100644 index 00000000..b374a8b4 --- /dev/null +++ b/docs/integrations/skype.rst @@ -0,0 +1,2 @@ +Skype Chabot +============ diff --git a/docs/integrations/slack.rst b/docs/integrations/slack.rst new file mode 100644 index 00000000..dcb6ef83 --- /dev/null +++ b/docs/integrations/slack.rst @@ -0,0 +1,6 @@ +Slack App +========= + +A bot is a type of Slack App designed to interact with users via conversation. + +A bot is the same as a regular app: it can access the same range of APIs and do all of the magical things that a Slack App can do. \ No newline at end of file diff --git a/docs/integrations/telegram.rst b/docs/integrations/telegram.rst new file mode 100644 index 00000000..a84945ed --- /dev/null +++ b/docs/integrations/telegram.rst @@ -0,0 +1,4 @@ +Telegram Bot Platform +===================== + +Bots are simply Telegram accounts operated by software – not people – and they'll often have AI features. They can do anything – teach, play, search, broadcast, remind, connect, integrate with other services, or even pass commands to the Internet of Things. \ No newline at end of file diff --git a/docs/models/penntreebank.rst b/docs/models/penntreebank.rst new file mode 100644 index 00000000..b18671d9 --- /dev/null +++ b/docs/models/penntreebank.rst @@ -0,0 +1,2 @@ +Penn Treebank +============= diff --git a/docs/models/tfidf.rst b/docs/models/tfidf.rst new file mode 100644 index 00000000..6daa95f6 --- /dev/null +++ b/docs/models/tfidf.rst @@ -0,0 +1,2 @@ +TF-IDF +====== diff --git a/docs/static/screenshots/APIHome.png b/docs/static/screenshots/APIHome.png new file mode 100644 index 00000000..d75dc395 Binary files /dev/null and b/docs/static/screenshots/APIHome.png differ diff --git a/docs/static/screenshots/APITestInput.png b/docs/static/screenshots/APITestInput.png new file mode 100644 index 00000000..41b4fab0 Binary files /dev/null and b/docs/static/screenshots/APITestInput.png differ diff --git a/docs/static/screenshots/APITestResult.png b/docs/static/screenshots/APITestResult.png new file mode 100644 index 00000000..f1a4a07d Binary files /dev/null and b/docs/static/screenshots/APITestResult.png differ diff --git a/docs/static/screenshots/APITrainCompleted.png b/docs/static/screenshots/APITrainCompleted.png new file mode 100644 index 00000000..b5f3d682 Binary files /dev/null and b/docs/static/screenshots/APITrainCompleted.png differ diff --git a/docs/static/screenshots/APITrainInProgress.png b/docs/static/screenshots/APITrainInProgress.png new file mode 100644 index 00000000..270e89db Binary files /dev/null and b/docs/static/screenshots/APITrainInProgress.png differ diff --git a/docs/static/screenshots/APITrainStart.png b/docs/static/screenshots/APITrainStart.png new file mode 100644 index 00000000..611c05da Binary files /dev/null and b/docs/static/screenshots/APITrainStart.png differ diff --git a/docs/static/screenshots/ArticulateHome.png b/docs/static/screenshots/ArticulateHome.png new file mode 100644 index 00000000..ef5d837a Binary files /dev/null and b/docs/static/screenshots/ArticulateHome.png differ diff --git a/docs/static/screenshots/RasaUIHome.png b/docs/static/screenshots/RasaUIHome.png new file mode 100644 index 00000000..298f5142 Binary files /dev/null and b/docs/static/screenshots/RasaUIHome.png differ diff --git a/docs/static/screenshots/RestoreAgentFromZip.png b/docs/static/screenshots/RestoreAgentFromZip.png new file mode 100644 index 00000000..445cc8a3 Binary files /dev/null and b/docs/static/screenshots/RestoreAgentFromZip.png differ