classifier 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c13b0ca80981d0186f038581e896182ca112928dcada4ac23700f2a9642ca785
4
- data.tar.gz: 1949dea18b6d7e06eb931d411e821757f75084c6776ea589927b1f1b89d82280
3
+ metadata.gz: ef8c75a0dfe0e6da3e2a7cf49d970c738913515b2f29f8759b8c2bc0df5ac8d0
4
+ data.tar.gz: 03b67f752c656af13f87edfd32fe56fe201e1a0521978b06ed6139a5d01569a9
5
5
  SHA512:
6
- metadata.gz: 562474db108e959f218407bd66a58bffe1b609ea38b8db16d15f579196d41d4976d74a66b6928e195ff0f6cc5dc4b081ea75d634cefb928e25932f8867358384
7
- data.tar.gz: 39f72068f85e64a6397672376f6fcc4821e1eccd9556813e4894ba62800975330051c87e88a8747f03278e6ad0e83a665ed48fcc6cc1f623cd91b657089f8dd6
6
+ metadata.gz: 42ac44b3698b864e27a47a79c468971e4c33f73e465a0c552715a93422e1cbbe009c57275378a330dd00607d4d3048590c805373e85f5bf31ecfaca4504ed311
7
+ data.tar.gz: 41fe7ff430019ff41a97a110784419049914f3a86cdcc383349c58770ab5419cbcb6bb99ae930d08058e1003d4efc8026616317b2096352abe473d54203e99c5
data/README.md CHANGED
@@ -24,6 +24,47 @@ Text classification in Ruby. Five algorithms, native performance, streaming supp
24
24
  gem 'classifier'
25
25
  ```
26
26
 
27
+ Or install via Homebrew for CLI-only usage:
28
+
29
+ ```bash
30
+ brew install classifier
31
+ ```
32
+
33
+ ## Command Line
34
+
35
+ Classify text instantly with pre-trained models—no coding required:
36
+
37
+ ```bash
38
+ # Detect spam
39
+ classifier classify "You won a free iPhone!" -r sms-spam-filter
40
+ # => spam
41
+
42
+ # Analyze sentiment
43
+ classifier classify "This movie was absolutely amazing!" -r imdb-sentiment
44
+ # => positive
45
+
46
+ # Detect emotions
47
+ classifier classify "I'm so happy today!" -r emotion-detection
48
+ # => joy
49
+
50
+ # List all available models
51
+ classifier models
52
+ ```
53
+
54
+ Train your own model:
55
+
56
+ ```bash
57
+ # Train from files
58
+ classifier train positive reviews/good/*.txt
59
+ classifier train negative reviews/bad/*.txt
60
+
61
+ # Classify new text
62
+ classifier classify "Great product, highly recommend"
63
+ # => positive
64
+ ```
65
+
66
+ [CLI Guide →](https://rubyclassifier.com/docs/guides/cli/basics)
67
+
27
68
  ## Quick Start
28
69
 
29
70
  ### Bayesian
data/exe/classifier CHANGED
@@ -1,4 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # Force UTF-8 encoding for proper handling of model data and user input
5
+ Encoding.default_external = Encoding::UTF_8
6
+ Encoding.default_internal = Encoding::UTF_8
7
+
2
8
  require 'classifier/cli'
3
9
 
4
10
  result = Classifier::CLI.new(ARGV).run
@@ -874,7 +874,7 @@ module Classifier
874
874
  return ''
875
875
  end
876
876
 
877
- response.body
877
+ response.body.force_encoding(Encoding::UTF_8)
878
878
  end
879
879
  end
880
880
  end
@@ -1,3 +1,3 @@
1
1
  module Classifier
2
- VERSION = '2.3.0'.freeze
2
+ VERSION = '2.3.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Carlson