Skip to main content

Haiku

This project had been deprecated. Maybe use deep learning.

Introduce

A Modification of LibShortText and LIBLINEAR.

  • Uses Wissen Text Analyzer

  • Feature Selection

  • API Exported by Skitai App Engine

  • Win32 support (need MSVC)

Installation

git clone https://gitlab.com/hansroh/haiku
cd haiku
python setup.py build install

Basic Usage

import haiku

model_path = "./golforbed"
analyzer =  haiku.StandardAnalyzer (max_term = 200, stem_level = 2, make_lower_case = 1)

trainset = [
    ('Golf', "cloudy cold calm"),
    ('Golf', "sunny warm"),
    ('Bed', "rainy hot"),
    ('Golf', "sunny hot windy"),
    ('Bed', "windy cloudy cold"),
    ('Bed', "rainy cloudy cold"),
]

# training
h = haiku.Haiku (model_path, haiku.CL_L2, analyzer)
# pruning by document frequency and scoring by meth (FS_CF means category frequency)
h.select (data, mindf = 0, maxdf = 0, top = 0, meth = haiku.FS_CF)
# set training options: uni/bigram and feature representation
h.train (haiku.BIGRAM, haiku.FT_BIN)
h.close ()

# guessing
h = haiku.Haiku (model_path, haiku.CL_L2, analyzer)
h.load ()
print (h.guess ("sunny cold windy"))
h.close ()

Exporting API through Skitai App Engine

Place model data into app_root/resources/haikus/golforbed.

import haiku
import skitai

if __name__ == "__main__":

  pref = skitai.pref ()
  pref.config.resource_dir = skitai.joinpath ('resources')
  skitai.mount ("/", haiku, "app", pref)
  skitai.run (port = 5005)

Go to http://127.0.0.1:5000/haiku/golforbed/guess?q=sunny%20cold%20windy.

Metadata

Release files for haiku-lst 0.1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for haiku-lst 0.1.1.4
File Size Uploaded Provenance Actions
haiku-lst-0.1.1.4.tar.gz 136.2 kB Without provenance Details for haiku-lst-0.1.1.4.tar.gz

Release files / haiku-lst-0.1.1.4.tar.gz

Download URL haiku-lst-0.1.1.4.tar.gz
Size 136.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0a84a43f900a82020e6995556808059e9b797ca97dd688b57c0800b76fb8e20b
BLAKE2b-256 checksum
How to use checksums
20ad38f7f7ab630a76f909749565e52ae11421e769b6c8e691d6be6aa07f6a27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Security for haiku-lst 0.1.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page