8
n8n 한국어amn8n.com

평가 지표 예시:문자 유사도

중급

이것은Engineering, AI분야의자동화 워크플로우로, 12개의 노드를 포함합니다.주로 Set, Code, Webhook, Evaluation, HttpRequest 등의 노드를 사용하며인공지능 기술을 결합하여 스마트 자동화를 구현합니다. 평가 지표 예시: 문자열 유사도

사전 요구사항
  • HTTP Webhook 엔드포인트(n8n이 자동으로 생성)
  • 대상 API의 인증 정보가 필요할 수 있음
  • OpenAI API Key
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "bf40384a063e00f3b983f4f9bada22b57a8231a04c0fb48d363e26d7b0f2b7e7",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "b2a1a367-119f-4e2d-a982-ff675debf658",
      "name": "메모1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        220,
        -40
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 260,
        "content": "Check how far apart the actual code is from the expected code (a score of 1 is a perfect match)"
      },
      "typeVersion": 1
    },
    {
      "id": "f5413855-20de-4b77-ba90-18610a9d9b4d",
      "name": "메모3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1300,
        40
      ],
      "parameters": {
        "width": 300,
        "height": 500,
        "content": "## How it works\nThis template shows how to calculate a workflow evaluation metric: **text similarity, measured character-by-character**.\n\nThe workflow takes images of hand-written codes, extracts the code and compares it with the expected answer from the dataset.\n\nThe images look like this:\n![image](https://storage.googleapis.com/n8n_template_data/handwriting_scans/doc20250302_08223946_001.jpg)\n\nYou can find more information on workflow evaluation [here](https://docs.n8n.io/advanced-ai/evaluations/overview), and other metric examples [here](https://docs.n8n.io/advanced-ai/evaluations/metric-based-evaluations/#2-calculate-metrics)."
      },
      "typeVersion": 1
    },
    {
      "id": "8921a4c4-cee1-44e7-8dce-55219db519d7",
      "name": "메모4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        280
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 220,
        "content": "Read in [this test dataset](https://docs.google.com/spreadsheets/d/1uuPS5cHtSNZ6HNLOi75A2m8nVWZrdBZ_Ivf58osDAS8/edit?gid=1786963566#gid=1786963566) of images"
      },
      "typeVersion": 1
    },
    {
      "id": "fbf8337b-eb46-443a-8507-58a14b817be0",
      "name": "webhook 형식 매칭",
      "type": "n8n-nodes-base.set",
      "position": [
        -680,
        340
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "=  {\n    \"headers\": {\n    },\n    \"params\": {},\n    \"query\": {\n      \"url\": {{ $json.file_url.toJsonString() }}\n    },\n    \"body\": {},\n    \"executionMode\": \"test\"\n  }"
      },
      "typeVersion": 3.4
    },
    {
      "id": "a03c9b79-d45d-4842-9325-df1af37697eb",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -900,
        40
      ],
      "webhookId": "7ceb775c-b961-44f0-acfe-682a67612332",
      "parameters": {
        "path": "7ceb775c-b961-44f0-acfe-682a67612332",
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "85bd63e2-3039-4f0e-8721-bc2b843461c9",
      "name": "데이터셋 행 가져올 때",
      "type": "n8n-nodes-base.evaluationTrigger",
      "position": [
        -900,
        340
      ],
      "parameters": {
        "sheetName": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1uuPS5cHtSNZ6HNLOi75A2m8nVWZrdBZ_Ivf58osDAS8/edit?gid=1786963566#gid=1786963566"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1uuPS5cHtSNZ6HNLOi75A2m8nVWZrdBZ_Ivf58osDAS8/edit?gid=1786963566#gid=1786963566"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bpr2LoSELMlxpwnN",
          "name": "Google Sheets account David"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "4ed0b460-70af-4f1d-a7f3-97293f9b4ce0",
      "name": "Webhook에 응답",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        260,
        320
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "f1642aa1-94c5-4002-a7aa-533566dd20eb",
      "name": "평가 중?",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        -20,
        200
      ],
      "parameters": {
        "operation": "checkIfEvaluating"
      },
      "typeVersion": 4.6
    },
    {
      "id": "15115588-b9ca-4e24-b7d8-f0aa0974b5dd",
      "name": "지표 설정",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        480,
        80
      ],
      "parameters": {
        "metrics": {
          "assignments": [
            {
              "id": "0e507b06-e6d5-4ace-aa22-f06c6db5b883",
              "name": "score",
              "type": "number",
              "value": "={{ $json.score }}"
            }
          ]
        },
        "operation": "setMetrics"
      },
      "typeVersion": 4.6
    },
    {
      "id": "af028132-c866-487d-be85-e3af049bc793",
      "name": "이미지에서 코드 추출",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -240,
        200
      ],
      "parameters": {
        "text": "=Extract ONLY the handwritten code in the top-right corner of this image.\n\nThe code MUST follow this EXACT format:\nBT/ED/[1-3 capital letters]/[1-3 capital letters]/[1-3 capital letters]/[1-3 capital letters or empty]/[single letter + number (2-4 chars total)]\n\nExamples of correct format:\nBT/ED/ABC/DE/F/G/H1\nBT/ED/A/BC/DEF/GH/I23\nBT/ED/AB/CD/EF/GH/I234\n\nDO NOT include any explanations, notes, or other text.\nDO NOT return anything if the code doesn't match the required format.\nVERIFY the extracted code matches the format before returning it.\nReturn ONLY the extracted code - nothing else.",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "id": "Ag9qPAsY7lpIGkvC",
          "name": "JPs n8n openAI key"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "50a26635-078f-40a7-8944-2e43ed8cd482",
      "name": "문자열 거리 계산",
      "type": "n8n-nodes-base.code",
      "position": [
        260,
        80
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const expected_code = $('When fetching a dataset row').item.json.expected_output\nconst actual_code = $json.content\n\nfunction levenshteinDistance(str1, str2) {\n  const m = str1.length;\n  const n = str2.length;\n  const dp = Array(m + 1).fill().map(() => Array(n + 1).fill(0));\n\n  for (let i = 0; i <= m; i++) {\n    dp[i][0] = i;\n  }\n  \n  for (let j = 0; j <= n; j++) {\n    dp[0][j] = j;\n  }\n\n  for (let i = 1; i <= m; i++) {\n    for (let j = 1; j <= n; j++) {\n      if (str1[i - 1] === str2[j - 1]) {\n        dp[i][j] = dp[i - 1][j - 1];\n      } else {\n        dp[i][j] = 1 + Math.min(\n          dp[i - 1][j],     // deletion\n          dp[i][j - 1],     // insertion\n          dp[i - 1][j - 1]  // substitution\n        );\n      }\n    }\n  }\n\n  return dp[m][n];\n}\n\nconst dist = levenshteinDistance(\n  expected_code, \n  actual_code\n)\n\nconst max_dist = Math.max(\n  expected_code.length,\n  actual_code.length\n)\n\nconsole.log('truth', expected_code)\nconsole.log('effort', actual_code)\nconsole.log('dist', dist)\nconsole.log('max_dist', max_dist)\n\n$input.item.json.score = 1 - (dist / max_dist)\n\nreturn $input.item;"
      },
      "typeVersion": 2
    },
    {
      "id": "383db4b0-9665-4608-bbf9-3dca88508bff",
      "name": "이미지 다운로드",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -460,
        200
      ],
      "parameters": {
        "url": "={{ $json.query.url }}",
        "options": {}
      },
      "typeVersion": 4.2
    }
  ],
  "pinData": {},
  "connections": {
    "a03c9b79-d45d-4842-9325-df1af37697eb": {
      "main": [
        [
          {
            "node": "383db4b0-9665-4608-bbf9-3dca88508bff",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f1642aa1-94c5-4002-a7aa-533566dd20eb": {
      "main": [
        [
          {
            "node": "50a26635-078f-40a7-8944-2e43ed8cd482",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "4ed0b460-70af-4f1d-a7f3-97293f9b4ce0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "383db4b0-9665-4608-bbf9-3dca88508bff": {
      "main": [
        [
          {
            "node": "af028132-c866-487d-be85-e3af049bc793",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "50a26635-078f-40a7-8944-2e43ed8cd482": {
      "main": [
        [
          {
            "node": "15115588-b9ca-4e24-b7d8-f0aa0974b5dd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fbf8337b-eb46-443a-8507-58a14b817be0": {
      "main": [
        [
          {
            "node": "383db4b0-9665-4608-bbf9-3dca88508bff",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "af028132-c866-487d-be85-e3af049bc793": {
      "main": [
        [
          {
            "node": "f1642aa1-94c5-4002-a7aa-533566dd20eb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "85bd63e2-3039-4f0e-8721-bc2b843461c9": {
      "main": [
        [
          {
            "node": "fbf8337b-eb46-443a-8507-58a14b817be0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급 - 엔지니어링, 인공지능

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수12
카테고리2
노드 유형9
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34