소스 정보
- 저장소
- javimosch/open-claw-skills
- 최근 소스 활동
- 2026년 6월 6일 19:20
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/javimosch/open-claw-skills --skill nlp-toolkit명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| id | nlp-toolkit |
| version | 1.0.0 |
| name | NLP Toolkit |
| description | Advanced NLP with perplexity scoring, burstiness analysis, and entropy calculation |
| author | NeoClaw Team |
| category | detection |
| tags | ["nlp","perplexity","burstiness","entropy"] |
| dependencies | [] |
Advanced NLP analysis for AI content detection using statistical measures.
/**
* Analyze text using NLP metrics
* @param {string} text - Text to analyze
* @param {object} options - Configuration options
* @returns {object} NLP analysis results
*/
async function analyzeText(text, options = {}) {
const {
perplexityThreshold = 45.0,
burstinessThreshold = 0.35,
minTextLength = 50
} = options;
if (text.length < minTextLength) {
return {
error: 'Text too short for analysis',
minLength: minTextLength
};
}
// Calculate perplexity (simplified)
const perplexity = calculatePerplexity(text);
// Calculate burstiness
const burstiness = calculateBurstiness(text);
// Calculate entropy
const entropy = calculateEntropy(text);
// Token distribution analysis
const tokenStats = analyzeTokenDistribution(text);
// Determine if AI-generated
const isAI = perplexity < perplexityThreshold && burstiness < burstinessThreshold;
const confidence = calculateConfidence(perplexity, burstiness, entropy);
return {
isAI,
confidence: Math.round(confidence * 100),
metrics: {
perplexity: Math.round(perplexity * 100) / 100,
burstiness: Math.round(burstiness * 100) / 100,
entropy: Math.round(entropy * 100) / 100
},
tokenStats,
thresholds: {
perplexity: perplexityThreshold,
burstiness: burstinessThreshold
},
explanation: isAI ?
'Low perplexity and uniform burstiness suggest AI generation' :
'Natural variation in metrics suggests human writing'
};
}
/**
* Calculate perplexity score (simplified)
*/
function calculatePerplexity(text) {
const words = text.toLowerCase().split(/\s+/);
const uniqueWords = new Set(words);
// Simplified perplexity: ratio of unique words to total
// Real perplexity requires language model
const ratio = uniqueWords.size / words.length;
const perplexity = 100 / ratio; // Inverse relationship
return Math.min(perplexity, 100);
}
/**
* Calculate burstiness (variation in sentence length)
*/
function calculateBurstiness(text) {
const sentences = text.split(/[.!?]+/).filter(s => s.trim());
if (sentences.length < 2) return 0;
const lengths = sentences.map(s => s.split(/\s+/).length);
const avg = lengths.reduce((a, b) => a + b, 0) / lengths.length;
const variance = lengths.reduce((sum, len) => sum + Math.pow(len - avg, 2), 0) / lengths.length;
const stdDev = Math.sqrt(variance);
// Burstiness: coefficient of variation
const burstiness = stdDev / avg;
return Math.min(burstiness, 1.0);
}
/**
* Calculate Shannon entropy
*/
function calculateEntropy(text) {
const chars = text.toLowerCase().split('');
const freq = {};
// Count character frequencies
for (const char of chars) {
freq[char] = (freq[char] || 0) + 1;
}
// Calculate entropy
let entropy = 0;
const total = chars.length;
for (const count of Object.values(freq)) {
const p = count / total;
entropy -= p * Math.log2(p);
}
return entropy;
}
/**
* Analyze token distribution
*/
function analyzeTokenDistribution(text) {
const words = text.toLowerCase().split(/\s+/);
const uniqueWords = new Set(words);
return {
totalWords: words.length,
uniqueWords: uniqueWords.size,
vocabularyRichness: Math.round((uniqueWords.size / words.length) * 100) / 100
};
}
/**
* Calculate overall confidence
*/
function calculateConfidence(perplexity, burstiness, entropy) {
// Lower perplexity = more AI-like
const perplexityScore = Math.max(0, 1 - (perplexity / 100));
// Lower burstiness = more AI-like
const burstinessScore = Math.max(0, 1 - (burstiness / 0.5));
// Moderate entropy expected for AI
const entropyScore = (entropy > 3.5 && entropy < 5.0) ? 0.8 : 0.4;
const confidence = (perplexityScore + burstinessScore + entropyScore) / 3;
return Math.min(confidence, 1.0);
}
// Export for OpenClaw
module.exports = {
analyzeText,
calculatePerplexity,
calculateBurstiness,
calculateEntropy
};
const result = await skills.nlpToolkit.analyzeText(text, {
perplexityThreshold: 45.0,
burstinessThreshold: 0.35
});
console.log(`AI Detection: ${result.isAI} (${result.confidence}% confidence)`);
console.log(`Perplexity: ${result.metrics.perplexity}`);
console.log(`Burstiness: ${result.metrics.burstiness}`);
{
"perplexityThreshold": 45.0,
"burstinessThreshold": 0.35,
"minTextLength": 50
}