Git Product home page Git Product logo

elyzer's Introduction

Elyzer

See step-by-step how Elasticsearch custom analyzers decompose your text into tokens.

My therapist said this would be a good idea...

Doug:  hi
Eliza: How are you today.. What would you like to discuss?
Doug:  well I can't really see how my Elasticsearch analyzers work, on the inside
Eliza: How do you know you can't really see how your Elasticsearch analyzers work, on the inside?
Doug:  cause I call _analyze, and it does the whole analyzer or just one step
Eliza  What other reasons might there be?
Doug:  I guess nobody's gotten around to making a good debugger
Eliza  I'm not sure I understand you fully.
Doug   well just keep reading this README then...
Eliza  Come, come, elucidate your thoughts.

Installation

Install through pip

pip install elyzer

Usage

Give Elyzer some text and have its analyzed. See the process broken down step-by-step on the command line.

Assuming I'd created an english_bigrams custom analyzer for the index tmdb, I would run the analyzer like so

$ elyzer --es "http://localhost:9200" --index tmdb --analyzer english_bigrams --text "Mary had a little lamb"
TOKENIZER: standard
{1:Mary}    {2:had} {3:a}   {4:little}  {5:lamb}    
TOKEN_FILTER: standard
{1:Mary}    {2:had} {3:a}   {4:little}  {5:lamb}    
TOKEN_FILTER: lowercase
{1:mary}    {2:had} {3:a}   {4:little}  {5:lamb}    
TOKEN_FILTER: porter_stem
{1:mari}    {2:had} {3:a}   {4:littl}   {5:lamb}    
TOKEN_FILTER: bigram_filter
{1:mari had}    {2:had a}   {3:a littl} {4:littl lamb}  

Output is each token, prefixed by the numerical position attribute in the token stream at each step.

Args

There are four required command line args:

  • es: the elasticsearch host (ie http://localhost:9200)
  • index: name of the index where your custom analyzer can be found
  • analyzer: name of your custom analyzer
  • text: the text to analyze

Shortcomings

aka "Areas for Improvement"

  • Only works for custom analyzers right now (as it accesses the settings for your index)
  • Attributes besides the token text and position would be handy

Who?

Created by OpenSource Connections

License

Released under Apache 2

elyzer's People

Contributors

softwaredoug avatar consulthys avatar

Stargazers

Aeisha avatar

Watchers

James Cloos avatar Aeisha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.