This skill provides comprehensive tools for building NLP applications using modern transformers, BERT, GPT, and classical NLP techniques for text classification, named entity recognition, sentiment analysis, and more.
Confirm successful installation by checking the skill directory location:
.cursor/skills/natural-language-processing
Restart Cursor to activate natural-language-processing. Access via /natural-language-processing in your agent's command palette.
β
Security Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
This skill provides comprehensive tools for building NLP applications using modern transformers, BERT, GPT, and classical NLP techniques for text classification, named entity recognition, sentiment analysis, and more.
When to Use
Building text classification systems for sentiment analysis, topic categorization, or intent detection
Extracting named entities (people, places, organizations) from unstructured text
Implementing machine translation, text summarization, or question answering systems
Processing and analyzing large volumes of textual data for insights
Creating chatbots, virtual assistants, or conversational AI applications
Fine-tuning pre-trained transformer models for domain-specific NLP tasks
NLP Core Tasks
Text Classification: Sentiment, topic, intent classification
Named Entity Recognition: Identifying people, places, organizations
Machine Translation: Text translation between languages
Text Summarization: Extracting key information
Question Answering: Finding answers in documents
Text Generation: Generating coherent text
Popular Models and Libraries
Transformers: BERT, GPT, RoBERTa, T5
spaCy: Industrial NLP pipeline
NLTK: Classic NLP toolkit
Hugging Face: Pre-trained models hub
PyTorch/TensorFlow: Deep learning frameworks
Python Implementation
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from collections import Counter
import re
import nltk
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer, WordNetLemmatizer
import torch
from transformers import(AutoTokenizer, AutoModelForSequenceClassification, AutoModelForTokenClassification, pipeline, TextClassificationPipeline)from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
import warnings
warnings.filterwarnings('ignore')# Download required NLTK resourcestry: nltk.data.find('tokenizers/punkt')except LookupError: nltk.download('punkt')print("=== 1. Text Preprocessing ===")defpreprocess_text(text, remove_stopwords=True, lemmatize=True):"""Complete text preprocessing pipeline"""# Lowercase text = text.lower()# Remove special characters and digits text = re.sub(r'[^a-zA-Z\s]','', text)# Tokenize tokens = word_tokenize(text)# Remove stopwordsif remove_stopwords: stop_words =set(stopwords.words('english')) tokens =[t for t in tokens if t notin stop_words]# Lemmatizeif lemmatize: lemmatizer = WordNetLemmatizer() tokens =[lemmatizer.lemmatize(t)for t in tokens]return tokens,' '.join(tokens)sample_text ="The quick brown foxes are jumping over the lazy dogs! Amazing performance."tokens, processed = preprocess_text(sample_text)print(f"Original: {sample_text}")print(f"Processed: {processed}")print(f"Tokens: {tokens}\n")# 2. Text Classification with sklearnprint("=== 2. Traditional Text Classification ===")# Sample datatexts =["I love this product, it's amazing!","This movie is fantastic and entertaining.","Best purchase ever, highly recommended.","Terrible quality, very disappointed.","Worst experience, waste of money.","Horrible service and poor quality.","The food was delicious and fresh.","Great atmosphere and friendly staff.","Bad weather today, very gloomy.","The book was boring and uninteresting."]labels =[1,1,1,0,0,0,1,1,0,0]# 1: positive, 0: negative# TF-IDF vectorizationtfidf = TfidfVectorizer(max_features=100, ngram_range=(1,2))X_tfidf = tfidf.fit_transform(texts)# Train classifierclf = MultinomialNB()clf.fit(X_tfidf, labels)# Evaluatepredictions = clf.predict(X_tfidf)print(f"Accuracy: {accuracy_score(labels, predictions):.4f}")print(f"Precision: {precision_score(labels, predictions):.4f}")print(f"Recall: {recall_score(labels, predictions):.4f}")print(f"F1: {f1_score(labels, predictions):.4f}\n")# 3. Transformer-based text classificationprint("=== 3. Transformer-based Classification ===")try:# Use Hugging Face transformers for sentiment analysis sentiment_pipeline = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english") test_sentences =["This is a wonderful movie!","I absolutely hate this product.","It's okay, nothing special.","Amazing quality and fast delivery!"]print("Sentiment Analysis Results:")for sentence in test_sentences: result = sentiment_pipeline(sentence)print(f" Text: {sentence}")print(f" Sentiment: {result[0]['label']}, Score: {result[0]['score']:.4f}\n")except Exception as e:print(f"Transformer model not available: {str(e)}\n")# 4. Named Entity Recognition (NER)
β
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
βΊAccess to product documentation and roadmap tools (Jira, Notion, etc.)
βΊUnderstanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
βΊStakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Steps
1Install product management skill
2Start with user story generation for known feature
3Progress to competitive analysis: research 2-3 competitors
4Use for roadmap prioritization: apply RICE/ICE scoring
5Draft stakeholder communications and refine based on feedback
6Build template library for recurring PM tasks
7Share effective prompts with product team
Common Pitfalls
β Not validating competitive researchβverify facts before sharing
β Accepting user stories without involving engineering team
β Over-relying on frameworks without qualitative judgment
β Not customizing outputs to company culture and communication style
β Skipping stakeholder validation of generated requirements
Best Practices
β Do
+Validate research and competitive analysis with real data
+Collaborate with engineering when generating technical requirements
+Customize frameworks and templates to your company context
+Use skill for first drafts, refine with stakeholder input
+Document successful prompt patterns for PM tasks
+Combine AI efficiency with human judgment and intuition
β Don't
βDon't publish competitive analysis without fact-checking
βDon't finalize user stories without engineering review
βDon't make prioritization decisions solely on AI scoring
βDon't skip customer validation of generated requirements
βDon't ignore company-specific context and culture
π‘ Pro Tips
β Provide context: company goals, constraints, customer feedback
β Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
β Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
β Use skill for 70% generation + 30% customization to company needs
When to Use This
β Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
β Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path
1Basic: user stories, feature specs, status updates