GPT-specific pattern detection with model fingerprinting and version identification
针对GPT生成内容的专业检测,具备模型特定模式识别功能。
javascript
/
* 分析文本中的GPT特定模式和指纹
* @param {string} text - 待分析文本
* @param {object} options - 配置选项
* @returns {object} 包含模型识别的分析结果
*/
async function analyzeGPTContent(text, options = {}) {
const {
detectVersion = true,
checkWatermarks = true,
minConfidence = 0.7
} = options;
const normalizedText = text.toLowerCase();
const wordCount = text.split(/\s+/).length;
// GPT特定短语(较强指示器)
const gptPhrases = {
gpt-4: [
深入探讨, 的格局, 的领域, 值得注意的是,
多方面的, 微妙的, 全面的, 整体方法
],
gpt-3.5: [
作为一个AI语言模型, 我没有个人, 我为此道歉,
当然, 绝对, 此外, 而且
],
common: [
值得指出的是, 请记住, 总之,
总结来说, 概括而言, 应对, 的织锦
]
};
// 模型指纹识别
let gpt4Score = 0;
let gpt35Score = 0;
let commonScore = 0;
const foundPhrases = [];
// 检查GPT-4特定模式
for (const phrase of gptPhrases[gpt-4]) {
if (normalizedText.includes(phrase)) {
gpt4Score += 0.2;
foundPhrases.push({ phrase, model: gpt-4 });
}
}
// 检查GPT-3.5特定模式
for (const phrase of gptPhrases[gpt-3.5]) {
if (normalizedText.includes(phrase)) {
gpt35Score += 0.2;
foundPhrases.push({ phrase, model: gpt-3.5 });
}
}
// 检查通用GPT模式
for (const phrase of gptPhrases[common]) {
if (normalizedText.includes(phrase)) {
commonScore += 0.1;
foundPhrases.push({ phrase, model: common });
}
}
// 结构分析
const hasNumberedLists = (text.match(/\n\d+\./g) || []).length >= 3;
const hasBulletPoints = (text.match(/\n[•\-\*]/g) || []).length >= 3;
const structureScore = (hasNumberedLists || hasBulletPoints) ? 0.15 : 0;
// 句子一致性
const sentences = text.split(/[.!?]+/).filter(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;
// 计算置信度
const totalScore = gpt4Score + gpt35Score + commonScore + structureScore + uniformityScore;
const confidence = Math.min(totalScore, 1.0);
// 确定模型
let detectedModel = unknown;
if (gpt4Score > gpt35Score && gpt4Score > 0) {
detectedModel = gpt-4;
} else if (gpt35Score > gpt4Score && gpt35Score > 0) {
detectedModel = gpt-3.5;
} else if (commonScore > 0) {
detectedModel = gpt-family;
}
const isGPT = confidence >= minConfidence;
return {
isGPT,
confidence: Math.round(confidence * 100),
detectedModel: isGPT ? detectedModel : 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: hasNumberedLists || hasBulletPoints,
avgSentenceLength: Math.round(avgLength),
sentenceVariance: Math.round(variance)
},
recommendation: confidence >= 0.85 ? 极可能为GPT生成 :
confidence >= 0.70 ? 可能为GPT生成 :
confidence >= 0.50 ? 疑似GPT生成 :
不太可能是GPT或为人工撰写
};
}
// 为OpenClaw导出
module.exports = {
analyzeGPTContent
};
javascript
const result = await skills.gptAnalyzer.analyzeGPTContent(text);
if (result.isGPT) {
console.log(检测到GPT:${result.detectedModel}(置信度${result.confidence}%));
}
json
{
detectVersion: true,
minConfidence: 0.7
}
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 gpt-analyzer-1776420050 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 gpt-analyzer-1776420050 技能
skillhub install gpt-analyzer-1776420050
文件大小: 2.25 KB | 发布时间: 2026-4-17 18:51