Skip to main content

Module tree_kernel

Module tree_kernel 

Source
Expand description

Tree kernels for structured data similarity

This module provides kernel functions for tree-structured data, particularly useful for measuring similarity between hierarchical expressions like TLExpr.

§Tree Representations

Trees are represented as labeled nodes with children, where each node has:

  • A label (string identifier)
  • A list of child nodes

§Kernel Types

  • SubtreeKernel: Counts common subtrees between two trees
  • SubsetTreeKernel: Counts common tree fragments (allows gaps)
  • PartialTreeKernel: Partial subtree matching with decay factors

§References

  • Collins & Duffy (2001): “Convolution Kernels for Natural Language”
  • Moschitti (2006): “Making Tree Kernels Practical for Natural Language Learning”

Structs§

PartialTreeKernel
Partial tree kernel - allows partial subtree matching
PartialTreeKernelConfig
Configuration for partial tree kernel
SubsetTreeKernel
Subset tree kernel - allows gaps in tree fragments
SubsetTreeKernelConfig
Configuration for subset tree kernel
SubtreeKernel
Subtree kernel - counts common subtrees
SubtreeKernelConfig
Configuration for subtree kernel
TreeNode
A tree node with label and children