Cover image
Identificación de entidad
Public

Identificación de entidad

Try Now
2025-03-21

Servidor MCP (Protocolo de contexto del modelo) para identificar si dos conjuntos de datos son de la misma entidad. 识别两组数据是否来自同一主体的 MCP 服务器

3 years

Works with Finder

1

Github Watches

1

Github Forks

0

Github Stars

EntityIdentification

Identify whether two sets of data are from the same entity. 识别两组数据是否来自同一主体

This is a MCP (Model Context Protocol) server. 这是一个支持MCP协议的服务器。

Data Comparison Tool

This tool provides a comprehensive way to compare two sets of data, evaluating both exact and semantic equality of their values. It leverages text normalization and a language model to determine if the data originates from the same entity.

Features

  • Text Normalization: Converts text to lowercase, removes punctuation, and normalizes whitespace.
  • Value Comparison: Compares values directly and semantically (ignoring order for lists).
  • JSON Traversal: Iterates through each key in the JSON objects and compares corresponding values.
  • Language Model Integration: Uses a generative language model to assess semantic similarity and provide a final judgment on whether the data comes from the same entity.

Installation

To use this tool, ensure you have the necessary dependencies installed. You can install them using pip:

pip install genai

Usage

Functions

  1. normalize_text(text):

    • Normalizes the input text by converting it to lowercase, removing punctuation, and normalizing whitespace.
  2. compare_values(val1, val2):

    • Compares two values both exactly and semantically.
    • If the values are lists, it ignores the order of elements for semantic comparison.
  3. compare_json(json1, json2):

    • Compares two JSON objects key by key.
    • Uses compare_values to evaluate each key's values.
    • Integrates a language model to assess semantic similarity and provides a final judgment.

Example

import json
import genai
import re

# Define your JSON objects
json1 = {
    "name": "John Doe",
    "address": "123 Main St, Anytown, USA",
    "hobbies": ["reading", "hiking", "coding"]
}

json2 = {
    "name": "john doe",
    "address": "123 Main Street, Anytown, USA",
    "hobbies": ["coding", "hiking", "reading"]
}

# Compare the JSON objects
comparison_results = compare_json(json1, json2)

# Generate final matching result
model1 = genai.GenerativeModel("gemini-2.0-flash-thinking-exp")
result_matching = model1.generate_content("综合这些信息,你认为可以判断两个数据来自同一主体吗?"+json.dumps(comparison_results, ensure_ascii=False, indent=4))
print(result_matching.text)

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

If you have any questions or suggestions, please contact me:

Wechat qrcode_for_gh_643efb7db5bc_344(1)

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

    Reviews

    5 (1)
    Avatar
    user_x1b0DDD4
    2025-04-15

    The MCP Weather Server by aditi-joshi-usc is a game-changer for accurate and real-time weather updates. The interface is user-friendly, offering seamless navigation and detailed weather insights. The precision in forecasting is impressive, making it a reliable tool for daily use. Highly recommend this server for anyone needing dependable weather information! Check it out at https://mcp.so/server/mcp-weather-server/aditi-joshi-usc.