Gpt Analyzer — Gpt 分析器
v1.0.0GPT-specific pattern 检测ion with 模型 fingerprinting and version identification
运行时依赖
安装命令
点击复制技能文档
GPT 分析器
Specialized 检测ion for GPT-生成d content with 模型-specific pattern recognition.
Implementation /* Analyze text for GPT-specific patterns and fingerprints @param {string} text - Text to analyze @param {object} options - Configuration options @returns {object} Analysis 结果 with 模型 identification / a同步 function analyzeGPTContent(text, options = {}) { const { 检测Version = true, 检查Watermarks = true, minConfidence = 0.7 } = options;
const normalizedText = text.toLowerCase(); const wordCount = text.split(/\s+/).length;
// GPT-specific phrases (stronger indicators) const gptPhrases = { 'gpt-4': [ 'delve into', 'landscape of', 'realm of', 'it\'s 导入ant to note', 'multifaceted', 'nuanced', 'comprehensive', 'ho列出ic 应用roach' ], 'gpt-3.5': [ 'as an AI language 模型', 'i don\'t have personal', 'i apo记录ize for', 'certAInly', 'absolutely', 'furthermore', 'moreover' ], 'common': [ 'it\'s worth noting', 'keep in mind', 'in conclusion', 'to summarize', 'in summary', 'navigate the', 'tapestry of' ] };
// 模型 fingerprinting let gpt4Score = 0; let gpt35Score = 0; let commonScore = 0; const foundPhrases = [];
// 检查 GPT-4 specific patterns for (const phrase of gptPhrases['gpt-4']) { if (normalizedText.includes(phrase)) { gpt4Score += 0.2; foundPhrases.push({ phrase, 模型: 'gpt-4' }); } }
// 检查 GPT-3.5 specific patterns for (const phrase of gptPhrases['gpt-3.5']) { if (normalizedText.includes(phrase)) { gpt35Score += 0.2; foundPhrases.push({ phrase, 模型: 'gpt-3.5' }); } }
// 检查 common GPT patterns for (const phrase of gptPhrases['common']) { if (normalizedText.includes(phrase)) { commonScore += 0.1; foundPhrases.push({ phrase, 模型: 'common' }); } }
// Structure analysis const hasNumbered列出s = (text.match(/\n\d+\./g) || []).length >= 3; const hasBulletPoints = (text.match(/\n[•\-\]/g) || []).length >= 3; const structureScore = (hasNumbered列出s || hasBulletPoints) ? 0.15 : 0;
// Sentence uniformity const sentences = text.split(/[.!?]+/).过滤器(s => s.trim()); const avgLength = sentences.reduce((sum, s) => sum + s.length, 0) / sentences.length; const variance = sentences.reduce((sum, s) => sum + Math.pow(s.length - avgLength, 2), 0) / sentences.length; const uniformityScore = variance < 500 ? 0.1 : 0;
// Calculate confidence const totalScore = gpt4Score + gpt35Score + commonScore + structureScore + uniformityScore; const confidence = Math.min(totalScore, 1.0);
// Determine 模型 let 检测ed模型 = 'unknown'; if (gpt4Score > gpt35Score && gpt4Score > 0) { 检测ed模型 = 'gpt-4'; } else if (gpt35Score > gpt4Score && gpt35Score > 0) { 检测ed模型 = 'gpt-3.5'; } else if (commonScore > 0) { 检测ed模型 = 'gpt-family'; }
const isGPT = confidence >= minConfidence;
return { isGPT, confidence: Math.round(confidence 100), 检测ed模型: isGPT ? 检测ed模型 : 'not-gpt', scores: { gpt4: Math.round(gpt4Score 100) / 100, gpt35: Math.round(gpt35Score 100) / 100, common: Math.round(commonScore 100) / 100, structure: Math.round(structureScore 100) / 100, uniformity: Math.round(uniformityScore * 100) / 100 }, indicators: { foundPhrases: foundPhrases.length, hasStructure: hasNumbered列出s || hasBulletPoints, avgSentenceLength: Math.round(avgLength), sentenceVariance: Math.round(variance) }, recommendation: confidence >= 0.85 ? 'Very likely GPT' : confidence >= 0.70 ? 'Likely GPT' : confidence >= 0.50 ? 'Possibly GPT' : 'Unlikely GPT or human-written' }; }
// 导出 for OpenClaw 模块.导出s = { analyzeGPTContent };
Usage const 结果 = awAIt 技能s.gpt分析器.analyzeGPTContent(text);
if (结果.isGPT) {
console.记录(GPT 检测ed: ${结果.检测ed模型} (${结果.confidence}% confidence));
}
Configuration { "检测Version": true, "minConfidence": 0.7 }