This workshop is based on developing a web-based machine learning system for simple text classification. The following steps will show you how to set up a Node js server to run the core system of the machine learning (fasttext tool for text classification) on input from a user.
First of all, you must enter the commands to install npm in the Linux system so I downloaded the virtual box on my pc then in the terminal I wrote these commands to install npm.
Download npm
To install npm
sudo apt install npm
Then I create a folder and name it "sat" , placed in the desktop then I put the files :( index.html,index.js and train.txt ) in the folder .
First we should Go to the project folder directory
cd Desktop
cd sat
Then start to initialize requirements just follow these commands
npm init -y
1: Install node fasttext
npm install node-fasttext --save
2: Install Express:
npm install express --save
4: Install some cors issues:
npm install cors --save
Travis CI was the first CI as a Service tool. It introduced a new approach to building code in the cloud. This CI tool allows the user to sign up, link their repository, build, as well as test their apps.
Travis CI offers following benefits:
- You can monitor GitHub projects
- Runs Test and generate results quickly. Parallel test execution is possible.
- Build artifacts & check code quality
first go to the
Travis CI sign in with your account in GitHub
then accept the Authorization of Travis CI.
then click on your profile picture in the top right of your Travis Dashboard, click Settings and then the green Activate button, and select the repositories you want to use with Travis CI.
in package.json it was
"test": "echo \"Error: no test specified\" && exit 1"
change it to
"test": "echo \"No test specified\""
and in .travis.yml it was
Language: node_js
Node_js:
10
change it to
Language: node_js
Node_js:
-7
in termnal
git status
git add .
git commit -m " # commit"
git push
When you return to Travis CI and go to the intended repository and then click in branches, you will find pass like in this picture