Community

Generate keyword labels and legal category classification for a community of nodes. Uses TF-IDF vectorization on node summaries to extract top keywords, then classifies into legal categories: CRIMINAL, IMMIGRATION, CIVIL, ADMINISTRATIVE, or UNDEFINED.

POST/api/community

Generate keyword labels and legal category classification for a community of nodes. Uses TF-IDF vectorization on node summaries to extract top keywords, then classifies into legal categories: CRIMINAL, IMMIGRATION, CIVIL, ADMINISTRATIVE, or UNDEFINED.

Parameters

FieldTypeNotes
community_idintRequired. Identifier for the community.
nodesarrayRequired. Nodes with optional summary text.
nodes[].idstringOptional. ECLI or node identifier.
nodes[].summarystringRecommended. Case summary text used for keyword extraction.

Response fields

FieldDescription
community_idThe requested community identifier.
keywords.keywordsTop 3 extracted keywords (TF-IDF weighted).
keywords.categoryLegal category: CRIMINAL, IMMIGRATION, CIVIL, ADMINISTRATIVE, or UNDEFINED.
keywords.scoresTF-IDF relevance scores for each keyword.
node_countTotal nodes in the request.
summary_countNodes that had summary text.

Examples

Request

{
  "community_id": 1,
  "nodes": [
    {
      "id": "ECLI:NL:...",
      "summary": "Vreemdelingenrecht en asielaanvraag..."
    },
    {
      "id": "ECLI:NL:...",
      "summary": "Verblijfsvergunning en terugkeerbesluit..."
    }
  ]
}

Response

{
  "community_id": 1,
  "keywords": {
    "keywords": [
      "asiel",
      "vreemdeling",
      "verblijfsvergunning"
    ],
    "category": "IMMIGRATION",
    "scores": [0.29, 0.22, 0.18]
  },
  "node_count": 2,
  "summary_count": 2
}