Home

Awesome

query-segmenter

Query Segmentation for search

Install: pip install query_segmenter

Usage:

from query_segmenter.unsupervised import Segmenter

queries = [
  "iphone 6",
  "new iphone 6",
  "samsung galaxy s8",
  "old iphone 6",
  "iphone 7",
  "samsung galaxy note",
  ...
]

segmenter = Segmenter()
segmenter.compute_scores(queries)
segments = segmenter.segment('iphone 6 case')
print(segments)

>> ['iphone 6', 'case']