proposal-classifier 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aaee56ffed4868656d3125c7e9b92d2d01b37daf1d09611d08780acf7baef85d
4
- data.tar.gz: 608f7517934bbb4b31422fdf4479c24d3eb6f145600da4d3f27c76fee864f453
3
+ metadata.gz: 825ce2cda03f9c46f92acff84ca7fdb7e24e14f57996ed3737843b8e01723330
4
+ data.tar.gz: 817a1dd9f68cb1ebefe1ef2d68b5b3f1bf38ff72cc5bcf9624ea71a418d2801f
5
5
  SHA512:
6
- metadata.gz: a3a20ae0ffd91732f89fd4480a9bbf18ab18709ef4dd0f0903f4022a87f74564bb555fcc3b59d166e7041ed84c717e6544314fa0d961580fe800beb3b4adc705
7
- data.tar.gz: c6a9925d7f3f8c1d681a4cbb4985ce1961737b4d371ecee0a5c358cd3674e6bd6a29d8f56f1601270e494fb9f8cc5d28e040c2f7ce88fff6ce4b492c2661f127
6
+ metadata.gz: 139278c11a9642fe1499cbac5a9de1bf1bd219321def8216fd07954d681a808ee71c92cbbd2e0b07948dd0d34976f05bc9a6a9f51cda691621acaa33e98198fd
7
+ data.tar.gz: 64d508d35f6b69e1b29a6d56e77f19db257b973a04f3b6d38e7f7c8c8b2072961b5c83660eda2fbc78656b291a41acb7bc3b2d61a2e95f815dead4ce4061bb44
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Proposal
4
4
  module Classifier
5
- VERSION = "0.1.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
@@ -8,17 +8,18 @@ require_relative "classifier/version"
8
8
 
9
9
  module Proposal
10
10
  module Classifier
11
- class Error < StandardError; end
12
- def predict_onx(input_text)
11
+ class Model
12
+ def self.predict_onx(input_text)
13
13
  nlp = Spacy::Language.new("pt_core_news_lg")
14
14
  doc = nlp.read(input_text)
15
15
  vector = doc.vector
16
16
  scaled_array = (vector - vector.min) / (vector.max - vector.min) * (1 - 0) + 0
17
- model = OnnxRuntime::InferenceSession.new("lib/proposal/exported_model.onnx")
17
+ model = OnnxRuntime::InferenceSession.new("./exported_model.onnx")
18
18
  label_name = model.outputs()[0][:name]
19
19
  vector_fim_reshaped = scaled_array.reshape(1, -1)
20
20
  pred_onx = model.run([label_name], {X: vector_fim_reshaped})[0]
21
21
  return pred_onx
22
22
  end
23
+ end
23
24
  end
24
25
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proposal-classifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - chaydson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-26 00:00:00.000000000 Z
11
+ date: 2023-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: onnxruntime