Skip to content

Pattern

Introduction

Lettria uses NLP techniques and pre-defined rules to identify patterns in text data at the sentence level, to use in classification and categorisation.

Format

KeyTypeDescription
metadataMetadataMetadata
patternsPattern [ ]Patterns

Example

{
	"metadata": { "stats": { "label example": 1 } },
	"patterns": [
		{
			"id": "6087c69cbc96405b4517753b",
			"name": "label example",
			"label": "label example",
			"tokens": [
				{
					"source": "Victor",
					"sentence": 0,
					"index": 0,
					"source_indexes": [0, 6],
					"tags": [{ "name": "tag 1" }]
				}
			]
		}
	]
}

Metadata

Metadata Format

TypeDescription
statsobjectStats

Metadata Example

{
	"stats": { "label example": 1 }
}

Patterns

Pattern Format

KeyTypeDescription
idStringID
nameStringName
labelStringLabel
tokensToken [ ]Tokens

Pattern Example

{
	"id": "6087c69cbc96405b4517753b",
	"name": "label example",
	"label": "label example",
	"tokens": [
		{
			"source": "Victor",
			"sentence": 0,
			"index": 0,
			"source_indexes": [0, 6],
			"tags": [{ "name": "tag 1" }]
		}
	]
}

Token

Token Format
KeyTypeDescription
sourceStringSource
sentenceNumberSentence
indexNumberIndex
source_indexesNumber [ ]Source indexes
tagsTag [ ]Tags
Token Example
{
	"source": "Victor",
	"sentence": 0,
	"index": 0,
	"source_indexes": [0, 6],
	"tags": [{ "name": "tag 1" }]
}
Tag
Tag Format
KeyTypeDescription
nameStringName
Tag Example
{ "name": "tag 1" }

Next steps