
Analyzing Text With Nlp
- 45 installs
- 2.6k repo stars
- Updated August 5, 2026
- jeremylongshore/claude-code-plugins-plus
Analyzes text with NLP techniques including sentiment analysis, keyword extraction, named entity recognition, and topic modeling.
About
Runs NLP over text to extract sentiment, keywords, named entities, and topics via an nlp-text-analyzer plugin. A developer uses it to derive structured insights from reviews, documents, or other unstructured text.
- Sentiment analysis with confidence scoring
- Keyword extraction, NER, and topic modeling
Analyzing Text With Nlp by the numbers
- 45 all-time installs (skills.sh)
- +1 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #967 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus --skill analyzing-text-with-nlpAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 45 |
|---|---|
| repo stars | ★ 2.6k |
| Last updated | August 5, 2026 |
| Repository | jeremylongshore/claude-code-plugins-plus ↗ |
What it does
Analyzes text with NLP techniques including sentiment analysis, keyword extraction, named entity recognition, and topic modeling.
Files
Nlp Text Analyzer
Analyze text using NLP techniques including sentiment analysis, keyword extraction, named entity recognition, and topic modeling.
Overview
This skill empowers Claude to analyze text using the nlp-text-analyzer plugin, extracting meaningful information and insights. It facilitates tasks such as sentiment analysis, keyword extraction, and topic modeling, enabling a deeper understanding of textual data.
How It Works
1. Request Analysis: Claude receives a user request to analyze text. 2. Text Processing: The nlp-text-analyzer plugin processes the text using NLP techniques. 3. Insight Extraction: The plugin extracts insights such as sentiment, keywords, and topics.
When to Use This Skill
This skill activates when you need to:
- Perform sentiment analysis on a piece of text.
- Extract keywords from a document.
- Identify the main topics discussed in a text.
Examples
Example 1: Sentiment Analysis
User request: "Analyze the sentiment of this product review: 'I loved the product! It exceeded my expectations.'"
The skill will: 1. Process the review text using the nlp-text-analyzer plugin. 2. Determine the sentiment as positive and provide a confidence score.
Example 2: Keyword Extraction
User request: "Extract the keywords from this news article about the latest AI advancements."
The skill will: 1. Process the article text using the nlp-text-analyzer plugin. 2. Identify and return a list of relevant keywords, such as "AI", "advancements", "machine learning", and "neural networks".
Best Practices
- Clarity: Be specific in your requests to ensure accurate and relevant analysis.
- Context: Provide sufficient context to improve the quality of the analysis.
- Iteration: Refine your requests based on the initial results to achieve the desired outcome.
Integration
This skill can be integrated with other tools to provide a comprehensive workflow, such as using the extracted keywords to perform further research or using sentiment analysis to categorize customer feedback.
Prerequisites
- Appropriate file access permissions
- Required dependencies installed
Instructions
1. Invoke this skill when the trigger conditions are met 2. Provide necessary context and parameters 3. Review the generated output 4. Apply modifications as needed
Output
The skill produces structured output relevant to the task.
Error Handling
- Invalid input: Prompts for correction
- Missing dependencies: Lists required components
- Permission errors: Suggests remediation steps
Resources
- Project documentation
- Related skills and commands
Text Analysis Report
This report provides an analysis of the provided text, covering sentiment, keywords, and identified topics. Use this template to present your findings in a clear and organized manner.
1. Input Text
Instruction: Paste the text you analyzed below.
[PASTE YOUR TEXT HERE]Example:
This is an amazing product! I love the features and the ease of use. The customer service was also incredibly helpful and responsive. I would highly recommend this to anyone.2. Sentiment Analysis
Instruction: Summarize the overall sentiment of the text. Include the sentiment score (e.g., -1 to 1, where -1 is very negative and 1 is very positive) and a brief explanation.
Sentiment Score: [INSERT SENTIMENT SCORE HERE]
Analysis: [INSERT SENTIMENT ANALYSIS HERE. Explain why the text received that score. Provide specific examples from the text.]
Example:
Sentiment Score: 0.9
Analysis: The text expresses a highly positive sentiment. The words "amazing," "love," "helpful," and "recommend" all contribute to the strong positive score. The enthusiastic tone throughout the text further reinforces this sentiment.
3. Keyword Extraction
Instruction: List the most relevant keywords extracted from the text. Explain why these keywords are important and how they relate to the overall meaning of the text.
Keywords: [INSERT KEYWORDS HERE, SEPARATED BY COMMAS]
Analysis: [INSERT KEYWORD ANALYSIS HERE. Explain the significance of each keyword and how they relate to the text.]
Example:
Keywords: product, features, ease of use, customer service, helpful, recommend
Analysis: These keywords highlight the key aspects of the text. "Product" and "features" indicate that the text is discussing a specific product and its functionalities. "Ease of use" suggests a positive user experience. "Customer service" and "helpful" point to a positive interaction with the company. "Recommend" signifies a strong endorsement of the product.
4. Topic Modeling
Instruction: Identify the main topics discussed in the text. Briefly describe each topic and provide examples from the text that support your analysis.
Topics: [INSERT TOPICS HERE]
Analysis: [INSERT TOPIC ANALYSIS HERE. Explain each topic and provide supporting examples.]
Example:
Topics: Product Satisfaction, Customer Support
Analysis:
- Product Satisfaction: The text clearly expresses satisfaction with the product's features and user-friendliness. Phrases like "amazing product" and "ease of use" directly relate to this topic.
- Customer Support: The text also highlights positive experiences with customer support, mentioning their helpfulness and responsiveness. The phrase "customer service was also incredibly helpful and responsive" directly supports this topic.
5. Conclusion
Instruction: Provide a brief summary of the overall analysis. Highlight the key takeaways from the sentiment, keyword, and topic analyses.
[INSERT CONCLUSION HERE]
Example:
In conclusion, the text expresses a highly positive sentiment towards the product, with keywords and topics highlighting satisfaction with its features, ease of use, and the helpfulness of customer service. The overall analysis suggests a strong positive user experience and a high likelihood of recommendation.
Error Handling Examples for NLP Text Analyzer Plugin
This document provides examples of how to handle common errors that may arise when using the NLP Text Analyzer plugin. Implementing robust error handling is crucial for building reliable and user-friendly applications.
1. API Rate Limits
API rate limits are a common occurrence, especially when using external NLP services. When you exceed the rate limit, the API will typically return an error code (e.g., 429 Too Many Requests).
Handling Strategy:
- Retry Mechanism: Implement an exponential backoff retry mechanism. This involves waiting for an increasing amount of time before retrying the request.
Example:
# Placeholder: Replace with your specific NLP API call
def analyze_text_with_retry(text, max_retries=5, initial_delay=1):
retries = 0
delay = initial_delay
while retries < max_retries:
try:
# Placeholder: Replace with your API call function
result = analyze_text(text)
return result
except Exception as e:
# Placeholder: Check for specific rate limit error code (e.g., 429)
if "rate limit exceeded" in str(e).lower():
retries += 1
print(f"Rate limit exceeded. Retrying in {delay} seconds...")
time.sleep(delay)
delay *= 2 # Exponential backoff
else:
raise # Re-raise other exceptions
raise Exception("Max retries reached. Unable to analyze text due to rate limits.")
# Example Usage:
# text = "Placeholder: Your text to analyze"
# try:
# analysis_result = analyze_text_with_retry(text)
# print(analysis_result)
# except Exception as e:
# print(f"Error during analysis: {e}")Instructions:
1. Replace the placeholder comments with your actual code. 2. Adjust max_retries and initial_delay based on the API's recommendations. 3. Ensure the error check specifically targets rate-limiting errors. Different APIs have different error messages and codes.
2. Invalid Input
Invalid input can range from malformed text to unsupported languages.
Handling Strategy:
- Input Validation: Validate the input text before sending it to the NLP API.
- Error Messages: Provide informative error messages to the user.
Example:
# Placeholder: Replace with your specific NLP API call and language detection method
def analyze_text(text, language="en"):
# Placeholder: Add language detection here, if needed. Example:
# detected_language = detect_language(text)
# if detected_language != language:
# raise ValueError(f"Input language is not {language}. Detected: {detected_language}")
if not isinstance(text, str):
raise TypeError("Input must be a string.")
if not text:
raise ValueError("Input text cannot be empty.")
try:
# Placeholder: Replace with your API call function
result = perform_nlp_analysis(text, language)
return result
except Exception as e:
# Placeholder: Catch specific API errors related to invalid input
if "invalid input" in str(e).lower() or "bad request" in str(e).lower():
raise ValueError(f"Invalid input: {e}")
else:
raise # Re-raise other exceptions
# Example Usage:
# text = "Placeholder: Your text to analyze"
# try:
# analysis_result = analyze_text(text)
# print(analysis_result)
# except ValueError as e:
# print(f"Input error: {e}")
# except Exception as e:
# print(f"Other error: {e}")Instructions:
1. Replace the placeholder comments with your actual code. 2. Implement input validation checks relevant to your specific NLP task (e.g., maximum text length, allowed characters). 3. Catch specific API errors related to invalid input and provide helpful error messages. 4. Consider adding language detection to automatically determine the input language and handle unsupported languages gracefully.
3. Network Errors
Network errors can occur due to connectivity issues or server problems.
Handling Strategy:
- Retry Mechanism: Similar to API rate limits, implement a retry mechanism with exponential backoff.
- Timeout: Set a timeout for API requests to prevent the application from hanging indefinitely.
Example:
import requests
import time
# Placeholder: Replace with your specific NLP API endpoint
API_ENDPOINT = "Placeholder: Your API endpoint URL"
def analyze_text_with_retry(text, max_retries=3, initial_delay=1, timeout=10):
retries = 0
delay = initial_delay
while retries < max_retries:
try:
# Placeholder: Replace with your API key or authentication method
headers = {"Authorization": "Bearer Placeholder: Your API Key"}
data = {"text": text}
response = requests.post(API_ENDPOINT, headers=headers, json=data, timeout=timeout)
response.raise_for_status() # Raise HTTPError for bad responses (4xx or 5xx)
return response.json()
except requests.exceptions.RequestException as e:
retries += 1
print(f"Network error: {e}. Retrying in {delay} seconds...")
time.sleep(delay)
delay *= 2
raise Exception("Max retries reached. Unable to analyze text due to network errors.")
# Example Usage:
# text = "Placeholder: Your text to analyze"
# try:
# analysis_result = analyze_text_with_retry(text)
# print(analysis_result)
# except Exception as e:
# print(f"Error during analysis: {e}")Instructions:
1. Replace the placeholder comments with your actual code, including the API endpoint, authentication details, and request parameters. 2. Adjust max_retries, initial_delay, and timeout based on your network conditions and API requirements. 3. Use the requests library (or your preferred HTTP client) to make API requests. 4. Handle requests.exceptions.RequestException to catch various network-related errors.
4. Server-Side Errors
Server-side errors (e.g., 500 Internal Server Error) indicate problems on the NLP API's server.
Handling Strategy:
- Retry Mechanism: Implement a retry mechanism with exponential backoff, as these errors can be temporary.
- Logging: Log the error details for debugging purposes.
- User Notification: Inform the user that there is a problem with the service and that they should try again later.
Example:
import requests
import time
import logging
# Configure logging (optional)
logging.basicConfig(level=logging.ERROR, format='%(asctime)s - %(levelname)s - %(message)s')
# Placeholder: Replace with your specific NLP API endpoint
API_ENDPOINT = "Placeholder: Your API endpoint URL"
def analyze_text_with_retry(text, max_retries=3, initial_delay=1, timeout=10):
retries = 0
delay = initial_delay
while retries < max_retries:
try:
# Placeholder: Replace with your API key or authentication method
headers = {"Authorization": "Bearer Placeholder: Your API Key"}
data = {"text": text}
response = requests.post(API_ENDPOINT, headers=headers, json=data, timeout=timeout)
response.raise_for_status() # Raise HTTPError for bad responses (4xx or 5xx)
return response.json()
except requests.exceptions.RequestException as e:
logging.error(f"API request failed: {e}") # Log the error
retries += 1
print(f"Server error. Retrying in {delay} seconds...")
time.sleep(delay)
delay *= 2
raise Exception("Max retries reached. Unable to analyze text due to server errors.")
# Example Usage:
# text = "Placeholder: Your text to analyze"
# try:
# analysis_result = analyze_text_with_retry(text)
# print(analysis_result)
# except Exception as e:
# print(f"Error during analysis: {e}")
# print("There was a problem with the service. Please try again later.") # User notificationInstructions:
1. Replace the placeholder comments with your actual code, including the API endpoint, authentication details, and request parameters. 2. Adjust max_retries, initial_delay, and timeout based on your network conditions and API requirements. 3. Implement logging to record error details for debugging. 4. Provide a user-friendly message to inform the user about the server-side error.
By implementing these error handling strategies, you can create more robust and reliable NLP applications. Remember to tailor these examples to your specific use case and the requirements of the NLP APIs you are using.
{
"_comment": "Example text inputs and expected outputs for the NLP Text Analyzer plugin.",
"examples": [
{
"_comment": "Sentiment Analysis Example",
"task": "sentiment_analysis",
"input_text": "This is the best day ever! I'm so happy and excited.",
"expected_output": {
"sentiment": "positive",
"confidence": 0.95
}
},
{
"_comment": "Sentiment Analysis Example - Negative",
"task": "sentiment_analysis",
"input_text": "I'm feeling really down today. Everything seems to be going wrong.",
"expected_output": {
"sentiment": "negative",
"confidence": 0.88
}
},
{
"_comment": "Sentiment Analysis Example - Neutral",
"task": "sentiment_analysis",
"input_text": "The weather is cloudy today.",
"expected_output": {
"sentiment": "neutral",
"confidence": 0.75
}
},
{
"_comment": "Named Entity Recognition Example",
"task": "named_entity_recognition",
"input_text": "Barack Obama was the 44th President of the United States.",
"expected_output": [
{
"entity": "Barack Obama",
"type": "PERSON"
},
{
"entity": "President",
"type": "TITLE"
},
{
"entity": "United States",
"type": "GPE"
}
]
},
{
"_comment": "Text Summarization Example",
"task": "text_summarization",
"input_text": "The quick brown fox jumps over the lazy dog. This is a classic pangram, a sentence that contains all the letters of the alphabet. Pangrams are often used to test fonts or keyboard layouts. They can also be used to demonstrate handwriting skills.",
"expected_output": "This text is a classic pangram, a sentence containing all letters of the alphabet, used for testing fonts, keyboard layouts, and handwriting skills."
},
{
"_comment": "Keyword Extraction Example",
"task": "keyword_extraction",
"input_text": "Artificial intelligence is rapidly transforming various industries. Machine learning algorithms are becoming increasingly sophisticated, enabling automation and improved decision-making.",
"expected_output": [
"artificial intelligence",
"machine learning",
"algorithms",
"automation",
"decision-making"
]
},
{
"_comment": "Text Translation Example",
"task": "text_translation",
"source_language": "en",
"target_language": "es",
"input_text": "Hello, how are you?",
"expected_output": "Hola, ¿cómo estás?"
},
{
"_comment": "Question Answering Example",
"task": "question_answering",
"context_text": "The capital of France is Paris.",
"question_text": "What is the capital of France?",
"expected_output": "Paris"
}
]
}Assets
Bundled resources for nlp-text-analyzer skill
- [ ] example_text_inputs.json: A collection of example text inputs for various NLP tasks, along with expected outputs.
- [ ] analysis_report_template.md: Template for generating analysis reports with sections for sentiment, keywords, and topics.
- [ ] error_handling_examples.md: Examples of how to handle common errors in NLP tasks, such as API rate limits or invalid input.
References
Bundled resources for nlp-text-analyzer skill
#!/usr/bin/env python3
"""
nlp-text-analyzer - Analysis Script
Script to perform text analysis tasks (sentiment, keywords, topics) based on user input and specified parameters.
Generated: 2025-12-10 03:48:17
"""
import os
import json
import argparse
from pathlib import Path
from typing import Dict, List
from datetime import datetime
class Analyzer:
def __init__(self, target_path: str):
self.target_path = Path(target_path)
self.stats = {
'total_files': 0,
'total_size': 0,
'file_types': {},
'issues': [],
'recommendations': []
}
def analyze_directory(self) -> Dict:
"""Analyze directory structure and contents."""
if not self.target_path.exists():
self.stats['issues'].append(f"Path does not exist: {self.target_path}")
return self.stats
for file_path in self.target_path.rglob('*'):
if file_path.is_file():
self.analyze_file(file_path)
return self.stats
def analyze_file(self, file_path: Path):
"""Analyze individual file."""
self.stats['total_files'] += 1
self.stats['total_size'] += file_path.stat().st_size
# Track file types
ext = file_path.suffix.lower()
if ext:
self.stats['file_types'][ext] = self.stats['file_types'].get(ext, 0) + 1
# Check for potential issues
if file_path.stat().st_size > 100 * 1024 * 1024: # 100MB
self.stats['issues'].append(f"Large file: {file_path} ({file_path.stat().st_size // 1024 // 1024}MB)")
if file_path.stat().st_size == 0:
self.stats['issues'].append(f"Empty file: {file_path}")
def generate_recommendations(self):
"""Generate recommendations based on analysis."""
if self.stats['total_files'] == 0:
self.stats['recommendations'].append("No files found - check target path")
if len(self.stats['file_types']) > 20:
self.stats['recommendations'].append("Many file types detected - consider organizing")
if self.stats['total_size'] > 1024 * 1024 * 1024: # 1GB
self.stats['recommendations'].append("Large total size - consider archiving old data")
def generate_report(self) -> str:
"""Generate analysis report."""
report = []
report.append("\n" + "="*60)
report.append(f"ANALYSIS REPORT - nlp-text-analyzer")
report.append("="*60)
report.append(f"Target: {self.target_path}")
report.append(f"Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
report.append("")
# Statistics
report.append("📊 STATISTICS")
report.append(f" Total Files: {self.stats['total_files']:,}")
report.append(f" Total Size: {self.stats['total_size'] / 1024 / 1024:.2f} MB")
report.append(f" File Types: {len(self.stats['file_types'])}")
# Top file types
if self.stats['file_types']:
report.append("\n📁 TOP FILE TYPES")
sorted_types = sorted(self.stats['file_types'].items(), key=lambda x: x[1], reverse=True)[:5]
for ext, count in sorted_types:
report.append(f" {ext or 'no extension'}: {count} files")
# Issues
if self.stats['issues']:
report.append(f"\n⚠️ ISSUES ({len(self.stats['issues'])})")
for issue in self.stats['issues'][:10]:
report.append(f" - {issue}")
if len(self.stats['issues']) > 10:
report.append(f" ... and {len(self.stats['issues']) - 10} more")
# Recommendations
if self.stats['recommendations']:
report.append("\n💡 RECOMMENDATIONS")
for rec in self.stats['recommendations']:
report.append(f" - {rec}")
report.append("")
return "\n".join(report)
def main():
parser = argparse.ArgumentParser(description="Script to perform text analysis tasks (sentiment, keywords, topics) based on user input and specified parameters.")
parser.add_argument('target', help='Target directory to analyze')
parser.add_argument('--output', '-o', help='Output report file')
parser.add_argument('--json', action='store_true', help='Output as JSON')
args = parser.parse_args()
print(f"🔍 Analyzing {args.target}...")
analyzer = Analyzer(args.target)
stats = analyzer.analyze_directory()
analyzer.generate_recommendations()
if args.json:
output = json.dumps(stats, indent=2)
else:
output = analyzer.generate_report()
if args.output:
Path(args.output).write_text(output)
print(f"✓ Report saved to {args.output}")
else:
print(output)
return 0 if len(stats['issues']) == 0 else 1
if __name__ == "__main__":
import sys
sys.exit(main())
Scripts
Bundled resources for nlp-text-analyzer skill
- [x] analyze_text.py: Script to perform text analysis tasks (sentiment, keywords, topics) based on user input and specified parameters.
- [x] summarize_text.py: Script to generate concise summaries of input text, useful for extracting key information.
- [x] translate_text.py: Script to translate text between languages using a translation API.
Auto-Generated
Scripts generated on 2025-12-10 03:48:17