tomoto 0.3.3 → 0.4.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: daa9c454c4cf09e120dbbe17305d225be58ac5937c463886e87ea1b3c3b5d466
4
- data.tar.gz: f6c0c353a0efcc6026964e9125f1156b50e0d119506ecab2812522f7b716042d
3
+ metadata.gz: d7d16410002670991fd881e13f64195db9de29dfa5c383da2287d44c9053b500
4
+ data.tar.gz: 290254c48ed1c3ce1ff51e2bbe07a46ed02d05dab6bcc095f38cdbf499883561
5
5
  SHA512:
6
- metadata.gz: 874f531a75a62d2291793ded080f380f8103682c2ae2b087dd31a014533443d5f35a7ea4e634aabd246fab1564ece35679c60c0b6ffbb6a627d57048e32bf790
7
- data.tar.gz: e91bf3c618394f34f208fe4945729db6719a2cab1a8e7192e646b232d7e38274f2087808d145dccddb94b3cc632b9dddce82f942f051a4bf522ec5ec9d2c43b3
6
+ metadata.gz: 817a074c0f9969ded7592d70a2b3096ca91142470552e019bc95668b45b658d24010160bce53b356810b09f25288fd9fb9c070841b3587ea23e6099f528f94b0
7
+ data.tar.gz: 94764d26429358b30766a36ef899b6856b61c848ed575cf62911dae9a352344c9736cd86be859601642cde479ba810b607dd41730db920d0fa9170b71dc9fdf2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.4.0 (2023-12-28)
2
+
3
+ - Added precompiled gem for Linux ARM
4
+ - Updated tomoto to 0.12.7
5
+ - Dropped support for Ruby < 3
6
+
1
7
  ## 0.3.3 (2023-02-01)
2
8
 
3
9
  - Added `topic_label_dict` method to `LLDA`
@@ -1,3 +1,3 @@
1
1
  module Tomoto
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/tomoto.rb CHANGED
@@ -6,20 +6,20 @@ rescue LoadError
6
6
  end
7
7
 
8
8
  # modules
9
- require "tomoto/ct"
10
- require "tomoto/dmr"
11
- require "tomoto/dt"
12
- require "tomoto/gdmr"
13
- require "tomoto/hdp"
14
- require "tomoto/hlda"
15
- require "tomoto/hpa"
16
- require "tomoto/lda"
17
- require "tomoto/llda"
18
- require "tomoto/mglda"
19
- require "tomoto/pa"
20
- require "tomoto/plda"
21
- require "tomoto/slda"
22
- require "tomoto/version"
9
+ require_relative "tomoto/ct"
10
+ require_relative "tomoto/dmr"
11
+ require_relative "tomoto/dt"
12
+ require_relative "tomoto/gdmr"
13
+ require_relative "tomoto/hdp"
14
+ require_relative "tomoto/hlda"
15
+ require_relative "tomoto/hpa"
16
+ require_relative "tomoto/lda"
17
+ require_relative "tomoto/llda"
18
+ require_relative "tomoto/mglda"
19
+ require_relative "tomoto/pa"
20
+ require_relative "tomoto/plda"
21
+ require_relative "tomoto/slda"
22
+ require_relative "tomoto/version"
23
23
 
24
24
  module Tomoto
25
25
  PARALLEL_SCHEME = [:default, :none, :copy_merge, :partition]
@@ -305,6 +305,23 @@ tomotopy의 Python3 예제 코드는 https://github.com/bab2min/tomotopy/blob/ma
305
305
 
306
306
  역사
307
307
  -------
308
+ * 0.12.7 (2023-12-19)
309
+ * 신규 기능
310
+ * 토픽 모델 뷰어인 `tomotopy.viewer.open_viewer()`가 추가되었습니다.
311
+ * `tomotopy.utils.Corpus.process()`의 속도를 개선했습니다.
312
+ * Bug fixes
313
+ * `Document.span`이 이제 바이트 단위가 아니라 문자 단위로 범위를 제대로 반환합니다.
314
+
315
+ * 0.12.6 (2023-12-11)
316
+ * 신규 기능
317
+ * `tomotopy.LDAModel.train`과 `tomotopy.LDAModel.set_word_prior`에 몇가지 편의 기능을 추가했습니다.
318
+ * `LDAModel.train`가 이제 학습 진행상황을 모니터링할 수 있는 `callback`, `callback_interval`, `show_progres` 인자를 지원합니다.
319
+ * `LDAModel.set_word_prior`가 이제 `prior` 인자로 `Dict[int, float]` 타입도 받을 수 있게 되었습니다.
320
+
321
+ * 0.12.5 (2023-08-03)
322
+ * 신규 기능
323
+ * Linux ARM64 아키텍처에 대한 지원을 추가했습니다.
324
+
308
325
  * 0.12.4 (2023-01-22)
309
326
  * New features
310
327
  * macOS ARM64 아키텍처에 대한 지원을 추가했습니다.
@@ -309,6 +309,23 @@ meaning you can use it for any reasonable purpose and remain in complete ownersh
309
309
 
310
310
  History
311
311
  -------
312
+ * 0.12.7 (2023-12-19)
313
+ * New features
314
+ * Added Topic Model Viewer `tomotopy.viewer.open_viewer()`
315
+ * Optimized the performance of `tomotopy.utils.Corpus.process()`
316
+ * Bug fixes
317
+ * `Document.span` now returns the ranges in character unit, not in byte unit.
318
+
319
+ * 0.12.6 (2023-12-11)
320
+ * New features
321
+ * Added some convenience features to `tomotopy.LDAModel.train` and `tomotopy.LDAModel.set_word_prior`.
322
+ * `LDAModel.train` now has new arguments `callback`, `callback_interval` and `show_progres` to monitor the training progress.
323
+ * `LDAModel.set_word_prior` now can accept `Dict[int, float]` type as its argument `prior`.
324
+
325
+ * 0.12.5 (2023-08-03)
326
+ * New features
327
+ * Added support for Linux ARM64 architecture.
328
+
312
329
  * 0.12.4 (2023-01-22)
313
330
  * New features
314
331
  * Added support for macOS ARM64 architecture.
@@ -365,6 +365,7 @@ namespace tomoto
365
365
  {
366
366
  double ll = 0;
367
367
  const size_t V = this->realV;
368
+ if (V == 0) return 0;
368
369
  for (Tid t = 0; t < T; ++t)
369
370
  {
370
371
  // topic-word distribution
@@ -516,9 +516,14 @@ namespace tomoto
516
516
  return std::make_unique<_DocType>(as_mutable(this)->template _makeFromRawDoc<true>(rawDoc));
517
517
  }
518
518
 
519
+ size_t getNumTopicsForPrior() const override
520
+ {
521
+ return this->K + KL;
522
+ }
523
+
519
524
  void setWordPrior(const std::string& word, const std::vector<Float>& priors) override
520
525
  {
521
- if (priors.size() != this->K + KL) THROW_ERROR_WITH_INFO(exc::InvalidArgument, "priors.size() must be equal to K.");
526
+ if (priors.size() != this->K + KL) THROW_ERROR_WITH_INFO(exc::InvalidArgument, "priors.size() must be equal to K + KL.");
522
527
  for (auto p : priors)
523
528
  {
524
529
  if (p < 0) THROW_ERROR_WITH_INFO(exc::InvalidArgument, "priors must not be less than 0.");
@@ -460,6 +460,11 @@ namespace tomoto
460
460
  return ret;
461
461
  }
462
462
 
463
+ size_t getNumTopicsForPrior() const override
464
+ {
465
+ return this->K2;
466
+ }
467
+
463
468
  void setWordPrior(const std::string& word, const std::vector<Float>& priors) override
464
469
  {
465
470
  if (priors.size() != K2) THROW_ERROR_WITH_INFO(exc::InvalidArgument, "priors.size() must be equal to K2.");
@@ -257,6 +257,7 @@ namespace tomoto
257
257
  virtual void prepare(bool initDocs = true, size_t minWordCnt = 0, size_t minWordDf = 0, size_t removeTopN = 0, bool updateStopwords = true) = 0;
258
258
 
259
259
  virtual size_t getK() const = 0;
260
+ virtual size_t getNumTopicsForPrior() const = 0;
260
261
  virtual std::vector<Float> getWidsByTopic(size_t tid, bool normalize = true) const = 0;
261
262
  virtual std::vector<std::pair<std::string, Float>> getWordsByTopicSorted(size_t tid, size_t topN) const = 0;
262
263
 
@@ -725,6 +726,11 @@ namespace tomoto
725
726
  return 0;
726
727
  }
727
728
 
729
+ size_t getNumTopicsForPrior() const override
730
+ {
731
+ return this->getK();
732
+ }
733
+
728
734
  std::vector<Float> getWidsByTopic(size_t tid, bool normalize) const override
729
735
  {
730
736
  return static_cast<const _Derived*>(this)->_getWidsByTopic(tid, normalize);
@@ -116,7 +116,7 @@ namespace Eigen
116
116
 
117
117
  EIGEN_STRONG_INLINE Packet4f p_bool2float(const Packet4f& a)
118
118
  {
119
- return vcvtq_f32_s32(vandq_s32(a, vdupq_n_s32(1)));
119
+ return vcvtq_f32_s32(vandq_s32((Packet4i)a, vdupq_n_s32(1)));
120
120
  }
121
121
 
122
122
  EIGEN_STRONG_INLINE Packet4f p_bool2float(const Packet4i& a)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomoto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-02 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4'
19
+ version: '4.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4'
26
+ version: '4.1'
27
27
  description:
28
28
  email: andrew@ankane.org
29
29
  executables: []
@@ -546,14 +546,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
546
546
  requirements:
547
547
  - - ">="
548
548
  - !ruby/object:Gem::Version
549
- version: '2.7'
549
+ version: '3'
550
550
  required_rubygems_version: !ruby/object:Gem::Requirement
551
551
  requirements:
552
552
  - - ">="
553
553
  - !ruby/object:Gem::Version
554
554
  version: '0'
555
555
  requirements: []
556
- rubygems_version: 3.4.1
556
+ rubygems_version: 3.5.3
557
557
  signing_key:
558
558
  specification_version: 4
559
559
  summary: High performance topic modeling for Ruby