Skip to content

Commit

Permalink
NLP with JavaScript
Browse files Browse the repository at this point in the history
Natural Language Processing with JS
  • Loading branch information
Jcharis authored Sep 11, 2018
1 parent a4d13cf commit 285012d
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
31 changes: 31 additions & 0 deletions NLP with JavaScript/NLP-with-JavaScript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Natural Language Processing with JavaScript
+ understanding everyday language

#### Common Libraries & Packages
+ compromise.js
+ natural
+ sentiment
+ franc
+ talisman
+ etc

#### NLP with Compromise.js
+ Tokenization
+ Part of Speech Tagging
+ Word transformation
+ Entity Recognition
+ Match Finding
+ etc

#### NLP with Sentiment.js
+ For Sentiment Analysis

#### NLP with Franc
+ Language Detection



###### .
+ J-Secur1ty
+ Jesus Saves @ JCharisTech

65 changes: 65 additions & 0 deletions NLP with JavaScript/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<title>NLP with JavaScript</title>
<script src="https://unpkg.com/compromise@latest/builds/compromise.min.js"></script>

<script type="text/javascript">

var docx = nlp("Jack Ryan is a CIA Analyst in New York");
console.log(docx.data());
// Sentences
console.log(docx.sentences().data());

// Tokenization
console.log(docx.sentences().terms().out('array'));


// Part of Speech Tagging + Entities
console.log(docx.sentences().terms().out('tags'));

// Entity Recognition NER

console.log(docx.topics().data());

// Entity Recognition (NER) For People
console.log(docx.topics().people().text());
console.log(docx.people().text());

// Entity Recognition (NER) Firstname & last name
console.log(docx.people().firstNames().text());
console.log(docx.people().lastNames().text());

// Entity Recognition (NER) For Places

console.log(docx.places().text());
console.log(docx.topics().places().text());


// Entity Recognition (NER) For Organizations
console.log(docx.topics().organizations().text());


// Working with Nouns & Verbs

console.log(docx.nouns().text());
console.log(docx.verbs().data());

var docx2 = nlp("book");
console.log(docx2.nouns().toLowerCase().text());
console.log(docx2.nouns().toUpperCase().text());
console.log(docx2.nouns().toPlural().text());



</script>


</head>
<body>
<div style="background-color:silver;height:50px;padding:5px;text-align: center;">
<h2>NLP with JavaScript</h2>
</div>

</body>
</html>

0 comments on commit 285012d

Please sign in to comment.