post-tuto-deployment

授权协议 MIT License
开发语言 Python
所属分类 神经网络/人工智能、 机器学习/深度学习
软件类型 开源软件
地区 不详
投 递 者 孔睿
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

End 2 End Machine Learning : From Data Collection to Deployment ��

In this job, I collaborated with Ahmed BESBES

Medium post here.

You may also read about it here and here.

In this post, we'll go through the necessary steps to build and deploy a machine learning application. This starts from data collection to deployment; and the journey, you'll see, is exciting and fun. ��

Before we begin, let's have a look at the app we'll build:

As you see, this web app allows a user to evaluate random brands by writing reviews. While writing, the user will see the sentiment score of his input updating in real-time, alongside a proposed 1 to 5 rating.

The user can then change the rating in case the suggested one does not reflect his views, and submit.

You can think of this as a crowd sourcing app of brand reviews, with a sentiment analysis model that suggests ratings that the user can tweak and adapt afterwards.

To build this application, we'll follow these steps:

  • Collecting and scraping customer reviews data using Selenium and Scrapy
  • Training a deep learning sentiment classifier on this data using PyTorch
  • Building an interactive web app using Dash
  • Setting a REST API and a Postgres database
  • Dockerizing the app using Docker Compose
  • Deploying to AWS

Project architecture

Run the app locally

To run this project locally using Docker Compose run:

docker-compose build
docker-compose up

You can then access the dash app at http://localhost:8050

Development

If you want to contribute to this project and run each service independently:

Launch API

In order to launch the API, you will first need to run a local postgres db using Docker:

docker run --name postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=postgres -p 5432:5432 -d postgres

Then you'll have to type the following commands:

cd src/api/
python app.py

Launch Dash app

In order to run the dash server to visualize the output:

cd src/dash/
python app.py

How to contribute ��

Feel free to contribute! Report any bugs in the issue section.

Here are the few things we noticed, and wanted to add.

  • Add server-side pagination for Admin Page and GET /api/reviews route.
  • Protect admin page with authentication.
  • Either use Kubernetes or Amazon ECS to deploy the app on a cluster of containers, instead of on one single EC2 instance.
  • Use continuous deployment with Travis CI
  • Use a managed service such as RDD for the database

Licence

MIT

 相关资料
  • POST将数据发送到服务器。请求主体的类型由Content-Type标题指示。 PUT和POST之间的差PUT和POST是,PUT是幂等:调用它一次或多次连续具有相同的效果(也就是没有侧面的效果),在那里连续的相同的POST可具有额外的效果,如通过顺序数次。 POST请求经由通常发送 HTML 形式在服务器上的变化和结果。在这种情况下,内容类型是通过将适当的字符串在所选enctype的属性的<fo

  • Static Site Post Scheduler The post scheduler is a serverless project that gives static site owners the ability to schedule posts (or other site content). It works with any static site setup (Jekyll,

  • 我在$_post中遇到了一些问题,我想获得服务器发送的数据服务器发送?additionaldata.Cardholdername=test&additionaldata.Cardbin=123456 HTTP Post 以下是有关服务器发送内容的一些信息https://docs.adyen.com/developers/api-manual#notificationfields

  • 问题内容: 我正在尝试使用POST方法编写XMLHttpRequest。我过去已经使用GET方法设法使用XMLHttpRequest,但是在POST方面却很挣扎。 这是我的代码: 它基本上调用PHP脚本,然后将一些信息添加到数据库中。 问题答案: 好吧,我已经设法对它进行了排序。 奇怪的原因虽然可能与沙箱安全性有关,但是我没有使用完整的URL地址,而是使用了文件的相对路径,现在可以使用了。 谢谢大

  • 问题内容: 我正在尝试使用$ .post方法调用Web服务,我已经使用$ .ajax方法使它工作了: 但是,当我将相同的方法移到$ .post方法中时,它将无法工作: 我想念什么? 问题答案: 它不起作用,因为在您的方法中,您无法将请求的内容类型设置为。因此,不可能使用调用ASP.NET PageMethod,因为ASP.NET PageMethod需要JSON请求。您将不得不使用。 我将只修改,

  • BeanPostProcessor接口定义了您可以实现的回调方法,以提供您自己的实例化逻辑,依赖关系解析逻辑等。您还可以在Spring容器通过插入一个或多个实例化实例化,配置和初始化bean之后实现一些自定义逻辑BeanPostProcessor实现。 您可以配置多个BeanPostProcessor接口,并且您可以通过设置order属性来控制这些BeanPostProcessor接口的执行ord