Get started with nlp_compromise CDN
MIT licensed
Lightweight NLP toolkit: tokenization, POS tagging, named entity recognition .
Tags:- natural
- language
- nlp
- compromise
Stable version
Copied!
How to start using nlp_compromise CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with nlp_compromise CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="https://cdn.cdnhub.io/nlp_compromise/7.0.0/nlp_compromise.min.js"></script>
<script>
async function processText() {
const text = "I love playing soccer and eating pizza.";
const apiKey = "YOUR_API_KEY"; // Replace with your API key
const pipeline = new Compromise();
// Perform NLP tasks
const doc = pipeline.process(text);
// Extract named entities
const entities = doc.entities;
// Extract sentiment analysis
const sentiment = doc.sentiment.score;
// Log the results
console.log("Entities:", entities);
console.log("Sentiment:", sentiment);
// Make an API call to save the results
const response = await axios.post('https://your-api.com/process', { text, entities, sentiment }, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
});
console.log("API Response:", response.data);
}
processText();
</script>
</head>
<body></body>
</html>
All versions
2.0.0
2.0.1
2.0.2
2.0.3
3.0.0
3.0.1
3.0.2
3.0.3
3.0.4
3.0.5
3.0.6
3.0.8
4.1.2
4.10.1
4.10.3
4.10.4
4.10.5
4.10.6
4.11.0
4.11.1
4.12.0
4.12.1
4.2.0
4.2.1
4.2.2
4.2.3
4.2.4
4.3.0
4.3.1
4.3.4
4.5.0
4.5.1
4.6.1
4.6.2
4.6.3
4.8.2
4.9.0
4.9.1
4.9.2
5.1.0
5.2.0
6.1.1
6.1.2
6.1.3
6.1.4
6.2.0
6.2.1
6.3.0
6.3.1
6.4.1
6.4.2
6.4.4
6.4.5
6.4.6
6.4.7
6.5.0
6.5.1
6.5.2
6.5.3
6.5.4
6.5.5
*** 7.0.0
7.0.0-alpha1
7.0.0-alpha2
7.0.0-alpha3
7.0.0-alpha4
7.0.0-alpha5