Amazon Review Generator API
.Net Core 6 - Download Here
Visual Studio 2022 Community - Download Here
Docker - Download Here
Amazon Review Generator API that uses nGram model to generate amazon reviews.
NGrams are generated using ML .NET - Documentation
NGrams are created in 3s e.g. This | person | is, is | driving | a, a | blue | car.
Training data can be downloaded from Here althought not necessary because project already contains a data json file.
NOTE: Training data only uses the first 5000 lines of the Appliances.json file.
| Request | Endpoint |
|---|---|
| GET | /api/generate |
GET /api/generate => generates a random review defaulted to 50 words and returns a AmazonReviewModel which contains Text(Review Text) and ReviewScore.
Text is generated using a Dictionary where the Key is the first word and the value is any array of possible next words.
Review Score is generated by using Sentiment Analysis to determine if the text is positve, neutral or negataive. Sentiment Analysis is done using VaderSharp2 Nuget package
NOTE: Docker needs too be installed on your machine.
- Open command prompt and navigate to the project directory
e.gC:\User\ProjectFolder\AmazonReviewGeneratorAPI - Run the following command to create a Docker Container
docker build -t {ImageName} -f Dockerfile . - After the container has successfully built, run the following command
docker run -d --name {name} -p 8080:80 {ImageName} - To see docker container run the following command
docker ps -a - Open your browser and navigate to http://localhost:8080/api/generate