forked from Jcharis/Natural-Language-Processing-Tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Natural Language Processing with JS
- Loading branch information
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |