{"id":16995705,"url":"https://github.com/ducdev/evaluate-news-nlp","last_synced_at":"2026-05-13T07:07:02.496Z","repository":{"id":94179204,"uuid":"245672025","full_name":"ducdev/evaluate-news-nlp","owner":"ducdev","description":"evaluate-news-nlp","archived":false,"fork":false,"pushed_at":"2020-03-07T17:01:59.000Z","size":155,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T07:09:12.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ducdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-07T17:01:20.000Z","updated_at":"2020-03-07T17:03:29.000Z","dependencies_parsed_at":"2023-03-22T19:02:05.962Z","dependency_job_id":null,"html_url":"https://github.com/ducdev/evaluate-news-nlp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdev%2Fevaluate-news-nlp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdev%2Fevaluate-news-nlp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdev%2Fevaluate-news-nlp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdev%2Fevaluate-news-nlp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ducdev","download_url":"https://codeload.github.com/ducdev/evaluate-news-nlp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244918500,"owners_count":20531682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T03:49:37.399Z","updated_at":"2026-05-13T07:07:02.466Z","avatar_url":"https://github.com/ducdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deployment is running at\r\nhttps://evaluate-news-nlp.ducdev.now.sh/\r\n\r\n# Project Instructions\r\n\r\nThis repo is your starter code for the project. It is the same as the starter code we began with in lesson 2. Install and configure Webpack just as we did in the course. Feel free to refer to the course repo as you build this one, and remember to make frequent commits and to create and merge branches as necessary!\r\n\r\nThe goal of this project is to give you practice with:\r\n- Setting up Webpack\r\n- Sass styles\r\n- Webpack Loaders and Plugins\r\n- Creating layouts and page design\r\n- Service workers\r\n- Using APIs and creating requests to external urls\r\n\r\nOn top of that, I want to introduce you to the topic of Natural Language Processing. NLPs leverage machine learning and deep learning create a program that can interpret natural human speech. Systems like Alexa, Google Assistant, and many voice interaction programs are well known to us, but understanding human speech is an incredibly difficult task and requires a lot of resources to achieve. Full disclosure, this is the Wikipedia definition, but I found it to be a clear one:\r\n\r\n\u003e Natural language processing (NLP) is a subfield of computer science, information engineering, and artificial intelligence\r\nconcerned with the interactions between computers and human (natural) languages, in particular how to program computers to\r\nprocess and analyze large amounts of natural language data.\r\n\r\nYou could spend years and get a masters degree focusing on the details of creating NLP systems and algorithms. Typically, NLP programs require far more resources than individuals have access to, but a fairly new API called Aylien has put a public facing API in front of their NLP system. We will use it in this project to determine various attributes of an article or blog post.\r\n\r\n## Getting started\r\n\r\nIt would probably be good to first get your basic project setup and functioning. Follow the steps from the course up to Lesson 4 but don't add Service Workers just yet. We won't need the service workers during development and having extra caches floating around just means there's more potential for confusion. So, fork this repo and begin your project setup.\r\n\r\nRemember that once you clone, you will still need to install everything:\r\n\r\n`cd` into your new folder and run:\r\n- `npm install`\r\n\r\n## Setting up the API\r\n\r\nThe Aylien API is perhaps different than what you've used before. It has you install a node module to run certain commands through, it will simplify the requests we need to make from our node/express backend.\r\n\r\n### Step 1: Signup for an API key\r\nFirst, you will need to go [here](https://developer.aylien.com/signup). Signing up will get you an API key. Don't worry, at the time of this course, the API is free to use up to 1000 requests per day or 333 intensive requests. It is free to check how many requests you have remaining for the day.\r\n\r\n### Step 2: Install the SDK\r\nNext you'll need to get the SDK. SDK stands for Software Development Kit, and SDKs are usually a program that brings together various tools to help you work with a specific technology. SDKs will be available for all the major languages and platforms, for instance the Aylien SDK brings together a bunch of tools and functions that will make it possible to interface with their API from our server and is available for Node, Python, PHP, Go, Ruby and many others. We are going to use the Node one, the page is available [here](https://docs.aylien.com/textapi/sdks/#sdks). You get 1000 free requests per day.\u2028\r\n\r\n### Step 3: Require the SDK package\r\nInstall the SDK in your project and then we'll be ready to set up your server/index.js file.\r\n\r\nYour server index.js file must have these things:\r\n\r\n- [ ] Require the Aylien npm package\r\n```\r\nvar aylien = require(\"aylien_textapi\");\r\n```\r\n\r\n### Step 4: Environment Variables\r\nNext we need to declare our API keys, which will look something like this:\r\n```\r\n// set aylien API credentias\r\nvar textapi = new aylien({\r\n  application_id: \"your-api-id\",\r\n  application_key: \"your-key\"\r\n});\r\n```\r\n\r\n...but there's a problem with this. We are about to put our personal API keys into a file, but when we push, this file is going to be available PUBLICLY on Github. Private keys, visible publicly are never a good thing. So, we have to figure out a way to make that not happen. The way we will do that is with environment variables. Environment variables are pretty much like normal variables in that they have a name and hold a value, but these variables only belong to your system and won't be visible when you push to a different environment like Github.\r\n\r\n- [ ] Use npm or yarn to install the dotenv package ```npm install dotenv```. This will allow us to use environment variables we set in a new file\r\n- [ ] Create a new ```.env``` file in the root of your project\r\n- [ ] Go to your .gitignore file and add ```.env``` - this will make sure that we don't push our environment variables to Github! If you forget this step, all of the work we did to protect our API keys was pointless.\r\n- [ ] Fill the .env file with your API keys like this:\r\n```\r\nAPI_ID=**************************\r\nAPI_KEY=**************************\r\n```\r\n- [ ] Add this code to the very top of your server/index.js file:\r\n```\r\nconst dotenv = require('dotenv');\r\ndotenv.config();\r\n```\r\n- [ ] Reference variables you created in the .env file by putting ```process.env``` in front of it, an example might look like this:\r\n```\r\nconsole.log(`Your API key is ${process.env.API_KEY}`);\r\n```\r\n...Not that you would want to do that. This means that our updated API credential settings will look like this:\r\n```javascript\r\n// set aylien API credentials\r\n// NOTICE that textapi is the name I used, but it is arbitrary. \r\n// You could call it aylienapi, nlp, or anything else, \r\n//   just make sure to make that change universally!\r\nvar textapi = new aylien({\r\n  application_id: process.env.API_ID,\r\n  application_key: process.env.API_KEY\r\n});\r\n```\r\n\r\n### Step 5: Using the API\r\n\r\nWe're ready to go! The API has a lot of different endpoints you can take a look at [here](https://docs.aylien.com/textapi/endpoints/#api-endpoints). And you can see how using the SDK simplifies the requests we need to make. \r\n\r\nI won't provide further examples here, as it's up to you to create the various requests and make sure your server is set up appropriately.\r\n\r\n## After the Aylien API\r\n\r\nOnce you are hooked up to the Aylien API, you are most of the way there! Along with making sure you are following all the requirements in the project rubric in the classroom, here are a few other steps to make sure you take.\r\n\r\n- Parse the response body to dynamically fill content on the page.\r\n- Test that the server and form submission work, making sure to also handle error responses if the user input does not match API requirements.\u2028\r\n- Go back to the web pack config and add the setup for service workers. \u2028\r\n- Test that the site is now available even when you stop your local server\u2028\r\n\r\n## Deploying\r\n\r\nA great step to take with your finished project would be to deploy it! Unfortunately its a bit out of scope for me to explain too much about how to do that here, but checkout [Netlify](https://www.netlify.com/) or [Heroku](https://www.heroku.com/) for some really intuitive free hosting options.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducdev%2Fevaluate-news-nlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fducdev%2Fevaluate-news-nlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducdev%2Fevaluate-news-nlp/lists"}