Back to Skills

natural-language

Tokenize, tag, and analyze natural language text using Apple's NaturalLanguage framework and translate between languages with the Translation framework. Use when adding language identification, sentiment analysis, named entity recognition, part-of-speech tagging, text embeddings, or in-app translation to iOS/macOS/visionOS apps.

763stars41forksUpdated 6/18/2026

Security Assessment

Safe(100/100)
Security Score100/100

About natural-language

The natural-language skill provides on-device text analysis and language translation capabilities for iOS, macOS, and visionOS applications using Apple's NaturalLanguage and Translation frameworks. It enables developers to add intelligent text processing features without sending data to external servers, ensuring user privacy while performing operations like tokenization, language detection, sentiment analysis, named entity recognition, and in-app translation. This skill targets Swift 6.3 and iOS 26+, offering a modern approach to natural language processing in Apple ecosystem apps.

The skill encompasses two primary frameworks: NaturalLanguage for text analysis operations and Translation for language conversion. NaturalLanguage provides tokenization capabilities (breaking text into words, sentences, or paragraphs), part-of-speech tagging, named entity recognition to identify people, places, and organizations, sentiment analysis to determine emotional tone, language identification supporting multiple hypotheses with confidence scores, and text embeddings for semantic similarity comparisons. The Translation framework enables in-app language translation with both UI-based and programmatic approaches, supporting batch translation and language availability checks.

This skill is ideal for developers building content analysis tools, multilingual applications, text editors with intelligent features, social media apps requiring sentiment analysis, search systems using semantic understanding, or any application that needs to process and understand natural language text. It clearly defines scope boundaries, handling text analysis after acquisition while delegating OCR to vision-framework, speech-to-text to speech-recognition, and generative AI tasks to apple-on-device-ai. The skill emphasizes thread-safety considerations and provides practical examples for common use cases.

FAQ

What iOS and macOS versions does this skill support?

The skill targets Swift 6.3 with iOS 26+ for NaturalLanguage features. Translation framework has split availability: system translation presentation requires iOS 17.4+ / macOS 14.4+, while TranslationSession and batch translation require iOS 18+ / macOS 15+.

Are NaturalLanguage operations thread-safe?

No, NaturalLanguage classes like NLTokenizer and NLTagger are not thread-safe. Each instance must be used from a single thread or dispatch queue at a time to avoid concurrency issues.

Does this skill require internet connectivity or send data to external servers?

No, the NaturalLanguage framework performs all analysis on-device, ensuring privacy. Translation features also work on-device when source and target languages are installed locally, though language availability may vary.

What's the difference between this skill and Apple Intelligence features?

This skill focuses on traditional NLP tasks like tokenization, tagging, sentiment analysis, and translation using NaturalLanguage and Translation frameworks. Generative AI tasks, summarization, and Apple Intelligence workflows are handled by the apple-on-device-ai skill.

Can I use custom machine learning models for text classification?

Yes, the skill mentions support for custom NLModel classifiers and taggers, allowing you to train and deploy specialized text analysis models beyond the built-in capabilities.

All Files

3 files
evals/evals.json4.3 KB
View
SKILL.md13.8 KB
View
references/translation-patterns.md9.5 KB
View

Install natural-language

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill