Skip to content

Commit 2b1b8c5

Browse files
committed
Add LICENSE file and edit README file
1 parent 8cd50ce commit 2b1b8c5

File tree

3 files changed

+59
-86
lines changed

3 files changed

+59
-86
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) [2020] [Udacity]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 36 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,60 @@
1-
# Project Instructions
1+
# Evaluate a News Article with Natural Language Processing Project
22

3-
This 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!
3+
## Main Object
44

5-
The goal of this project is to give you practice with:
6-
- Setting up Webpack
7-
- Sass styles
8-
- Webpack Loaders and Plugins
9-
- Creating layouts and page design
10-
- Service workers
11-
- Using APIs and creating requests to external urls
12-
13-
On 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:
14-
15-
> Natural language processing (NLP) is a subfield of computer science, information engineering, and artificial intelligence
16-
concerned with the interactions between computers and human (natural) languages, in particular how to program computers to
17-
process and analyze large amounts of natural language data.
5+
This project is a web tool that allows users to run Natural Language Processing (NLP) on articles or blogs found on other websites with using an API called [MeaningCloud API](https://www.meaningcloud.com/developer/sentiment-analysis), we can build a simple web interface to interact with NLP system.
6+
We will use Sentiment Analysis API tools.
187

19-
You 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.
8+
#### What is Sentiment Analysis?
209

21-
## Getting started
10+
Sentiment Analysis is MeaningCloud's solution for performing a detailed multilingual sentiment analysis of texts from different sources.
2211

23-
It 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.
12+
The text provided is analyzed to determine if it expresses a positive/negative/neutral sentiment; to do this, the local polarity of the different sentences in the text is identified and the relationship between them evaluated, resulting in a global polarity value for the whole text.
2413

25-
Remember that once you clone, you will still need to install everything:
14+
Besides polarity at sentence and global level, Sentiment Analysis uses advanced natural language processing techniques to also detect the polarity associated to both entities and concepts in the text. It provides a reference in the relevant sentence and a list of elements detected with the aggregated polarity derived from all their appearances, also taking into account the grammatical structures in which they are contained.
2615

27-
`cd` into your new folder and run:
28-
- `npm install`
29-
30-
## Setting up the API
31-
32-
The 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.
16+
> Natural language processing (NLP) is a subfield of computer science, information engineering, and artificial intelligence
17+
> concerned with the interactions between computers and human (natural) languages, in particular how to program computers to
18+
> process and analyze large amounts of natural language data.
3319
34-
### Step 1: Signup for an API key
35-
First, 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.
20+
## Objects
3621

37-
### Step 2: Install the SDK
38-
Next 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.

22+
- Setting up Webpack
23+
- Sass styles
24+
- Webpack Loaders and Plugins
25+
- Creating layouts and page design
26+
- Service workers
27+
- Using APIs and creating requests to external urls
3928

40-
### Step 3: Require the SDK package
41-
Install the SDK in your project and then we'll be ready to set up your server/index.js file.
29+
---
4230

43-
Your server index.js file must have these things:
31+
## Tools
4432

45-
- [ ] Require the Aylien npm package
46-
```
47-
var aylien = require("aylien_textapi");
48-
```
33+
1- MeaningCloud Sentiment Analysis API
34+
You can find the API [here](https://www.meaningcloud.com/developer/sentiment-analysis). Create an account with MeaningCloud, you will be given a license key to start using the API.
35+
2- Environment Variables called dotenv
36+
We need to declare our API keys, which will look something like this:
4937

50-
### Step 4: Environment Variables
51-
Next we need to declare our API keys, which will look something like this:
52-
```
53-
// set aylien API credentias
54-
var textapi = new aylien({
55-
application_id: "your-api-id",
56-
application_key: "your-key"
57-
});
38+
```javascript
39+
// set MeaningCloud API credentias
40+
const apiKey = 'your-key';
5841
```
59-
6042
...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.
6143

62-
- [ ] 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
63-
- [ ] Create a new ```.env``` file in the root of your project
64-
- [ ] 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.
44+
We will use npm called dotenv to allow us to use environment variables.
45+
- [ ] Create a new ```.env``` file in the root of project
6546
- [ ] Fill the .env file with your API keys like this:
6647
```
67-
API_ID=**************************
6848
API_KEY=**************************
6949
```
70-
- [ ] Add this code to the very top of your server/index.js file:
71-
```
72-
const dotenv = require('dotenv');
73-
dotenv.config();
74-
```
75-
- [ ] Reference variables you created in the .env file by putting ```process.env``` in front of it, an example might look like this:
50+
- [ ] Start run the project
7651
```
77-
console.log(`Your API key is ${process.env.API_KEY}`);
52+
npm start
7853
```
79-
...Not that you would want to do that. This means that our updated API credential settings will look like this:
80-
```javascript
81-
// set aylien API credentials
82-
// NOTICE that textapi is the name I used, but it is arbitrary.
83-
// You could call it aylienapi, nlp, or anything else,
84-
// just make sure to make that change universally!
85-
var textapi = new aylien({
86-
application_id: process.env.API_ID,
87-
application_key: process.env.API_KEY
88-
});
89-
```
90-
91-
### Step 5: Using the API
92-
93-
We'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.
94-
95-
I 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.
96-
97-
## After the Aylien API
98-
99-
Once 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.
100-
101-
- Parse the response body to dynamically fill content on the page.
102-
- Test that the server and form submission work, making sure to also handle error responses if the user input does not match API requirements.

103-
- Go back to the web pack config and add the setup for service workers. 

104-
- Test that the site is now available even when you stop your local server

54+
### License
10555

106-
## Deploying
56+
Evaluate a News Article with Natural Language Processing App Project is Copyright © 2020 Udaciy.
57+
It is open source project, and redistributed under the terms specified in the
58+
[LICENSE] file.
10759

108-
A 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.
60+
[license]: https://github.com/mero2online/Project_4_-_Evaluate_a_News_Article_with_NLP/blob/master/LICENSE

src/client/styles/base.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ main {
1010
section {
1111
h1 {
1212
text-align: center;
13-
font-size: 3vw;
13+
font-size: 2.5vw;
1414
}
1515
}
1616
}
@@ -54,7 +54,7 @@ section {
5454
}
5555

5656
.collapsible {
57-
background-color: rgba(119, 119, 119, 0.356);
57+
background-color: #7777775b;
5858
color: white;
5959
cursor: pointer;
6060
padding: 8px;

0 commit comments

Comments
 (0)