AbstractIntegratedModule 0.2.1__tar.gz → 0.2.2__tar.gz

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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AbstractIntegratedModule
3
- Version: 0.2.1
4
- Summary: Advanced Integrated Non-LLM AI Module - Backend Framework for Non-LLM AI Agent Framework
3
+ Version: 0.2.2
4
+ Summary: Framework forAdvanced Integrated Non-LLM AI Module library - Backend Framework for Non-LLM AI Agent Framework
5
5
  Author: Micro-Novelty
6
6
  Author-email: hernikpuspita5@gmail.com
7
7
  License: MIT
@@ -40,7 +40,7 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
40
40
  #### Note: The README here you are reading is a direct copy from my README Repository, to download the necessary files, you can visit my Repository with the provided link above.
41
41
 
42
42
  ### Library Short Description:
43
- - Development Stage: Beta, 0.2.0.
43
+ - Development Stage: Beta, 0.2.2.
44
44
  - Maintainer: Micro-Novelty.
45
45
  - library Source-Code is Open-sourced on github.
46
46
  - Purpose: Specifically Designed for providing Non-LLM AI Agent Framework for edge Devices, Optimized for ARM64 architecture.
@@ -342,7 +342,8 @@ B. [=] Advanced Prediction without Transformer, Only Specialized MLP using AWE.
342
342
  ### Both performance Overview
343
343
  <img width="1536" height="1024" alt="WhatsApp Image 2026-05-24 at 10 27 00" src="https://github.com/user-attachments/assets/9404277f-281f-4893-8367-e494833230ea" />
344
344
 
345
- ## Source code of AbstractIntegratedModule
345
+ ## Source code of AbstractIntegratedModule
346
+ - Note: The source code is provided in the repository.
346
347
  - [=] Full Monolithic extensively-documented source code (12K+ Lines): [AbstractIntegratedPipeline-SourceCode.zip](AbstractIntegratedPipeline-SourceCode.zip)
347
348
  - [=] Separated Modules of AbstractIntegratedModule: [AbstractIntegratedModule-separated-modules](AbstractIntegratedModule-separated-modules)
348
349
  - [~] Note:
@@ -353,7 +354,21 @@ B. [=] Advanced Prediction without Transformer, Only Specialized MLP using AWE.
353
354
  - Commercialize it: Package, brand, and sell the software for profit.
354
355
 
355
356
  ## [=] Step's for in-depth Usage
356
- 1. Download:
357
+ 0. Download via PIP:
358
+ - Clone repository first:
359
+ ```bash
360
+ # Clone immediately for Windows and x86_64 only without prerequisites
361
+ git clone https://github.com/Micro-Novelty/IntegratedPipeline-Continous-Learning-AI-Agent-library-framework.git
362
+ cd IntegratedPipeline-Continous-Learning-AI-Agent-library-framework
363
+ ```
364
+
365
+ - Install the library via pip:
366
+ ```bash
367
+ pip install AbstractIntegratedModule #or
368
+ python -m pip install AbstractIntegratedModule
369
+ ```
370
+
371
+ 1. Download for binaries:
357
372
  - AbstractIntegratedModule.pyd (For Windows) (Python 3.13),
358
373
  - AbstractIntegratedModule.cpython-39-x86_64-linux-gnu.so (For linux x86_64) (Python 3.12)
359
374
  - AbstractIntegratedModule.cpython-39-aarch64-linux-gnu.so (for Linux ARM64 - Raspberry Pi) (Python 3.10)
@@ -518,8 +533,9 @@ B. [=] Advanced Prediction without Transformer, Only Specialized MLP using AWE.
518
533
  show_proba=False, top_k=3,
519
534
  use_transformer=True,
520
535
  return_attention=False,
521
- save_results=True)
522
-
536
+ save_results=True,
537
+ batch_size=2)
538
+ # batch size=2 is needed during transformer training for batching, if you have larger samples consider using batch_size > 8, for medium amount of samples (>10 -> <50 samples) consider using 2 or 4 batch_size.
523
539
  # ... more features you can add
524
540
  ```
525
541
 
@@ -1493,8 +1493,9 @@ class WeightedEnsemblePredictor:
1493
1493
  return probs
1494
1494
 
1495
1495
 
1496
- def predict_single(self, text, mlp_probs, trans_probs, attn_weights, show_explanation=True):
1497
- result, explanation = self.explainer._get_prediction_details(text, mlp_probs, trans_probs, attn_weights)
1496
+ def predict_single(self, text, mlp_probs, trans_probs, attn_weights, show_explanation=True, batch_size=2):
1497
+ # small batch size is used to prevent memory overflow in explanation module when processing large attention weights, as it computes detailed explanations that can be memory intensive.
1498
+ result, explanation = self.explainer._get_prediction_details(text, mlp_probs, trans_probs, attn_weights, batch_size=batch_size)
1498
1499
  return {
1499
1500
  'prediction': result['final_label'],
1500
1501
  'confidence': result['final_confidence'],
@@ -1940,7 +1941,7 @@ class ExplainabilityModule:
1940
1941
  filled = int(value * max_width)
1941
1942
  return '█' * filled + '░' * (max_width - filled)
1942
1943
 
1943
- def _learn_from_feedback(self, text, correct_label, wrong_result):
1944
+ def _learn_from_feedback(self, text, correct_label, wrong_result, batch_size=2):
1944
1945
  eps = 1e-5
1945
1946
  print(f"\n[📚] Learning: '{text}' → {correct_label}...")
1946
1947
 
@@ -2044,7 +2045,7 @@ class ExplainabilityModule:
2044
2045
  self.pipeline.memory[memory_key] = (X, correct_label)
2045
2046
 
2046
2047
  if len(self.learned_from_feedback) % 10 == 0:
2047
- self.consolidate_supervised_memories()
2048
+ self.consolidate_supervised_memories(batch_size=batch_size)
2048
2049
 
2049
2050
  return X
2050
2051
 
@@ -2132,7 +2133,7 @@ class ExplainabilityModule:
2132
2133
  return choice
2133
2134
  return None
2134
2135
 
2135
- def analyze_with_feedback(self, details, input_text, mlp_probs, trans_probs, attn_weights, explanation, auto_ask=True):
2136
+ def analyze_with_feedback(self, details, input_text, mlp_probs, trans_probs, attn_weights, explanation, batch_size=2, auto_ask=True):
2136
2137
  uncertain = self.pipeline.confidence_threshold
2137
2138
 
2138
2139
  input_ids = np.array([self.pipeline.encode(input_text, self.pipeline.vocab)])
@@ -2150,13 +2151,13 @@ class ExplainabilityModule:
2150
2151
  print(f"[📚] Received feedback: '{input_text}' should be '{feedback}'")
2151
2152
  print('[=] Supervised learning took many trials to get right. This is normal. Please be patient as the model updates continously each label request...')
2152
2153
 
2153
- evaluated_input = self._learn_from_feedback(input_text, feedback, details)
2154
+ evaluated_input = self._learn_from_feedback(input_text, feedback, details, batch_size=2)
2154
2155
  self.supervised_learning = False # Prevent infinite loop
2155
2156
  return False
2156
2157
 
2157
2158
  return False
2158
2159
 
2159
- def consolidate_supervised_memories(self):
2160
+ def consolidate_supervised_memories(self, batch_size=2):
2160
2161
  if not self.learned_from_feedback:
2161
2162
  return
2162
2163
 
@@ -2171,7 +2172,7 @@ class ExplainabilityModule:
2171
2172
  self.initialize_fitting(labels)
2172
2173
  X = self.tfidf.transform(labels).toarray()
2173
2174
 
2174
- self.pipeline.transformer_utilities(dataset, X)
2175
+ self.pipeline.transformer_utilities(dataset, X, batch_size=batch_size)
2175
2176
 
2176
2177
  print("✅ Supervised memories consolidated!")
2177
2178
 
@@ -2195,7 +2196,7 @@ class ExplainabilityModule:
2195
2196
  return uncertain
2196
2197
 
2197
2198
 
2198
- def _get_prediction_details(self, input_text, mlp_probs, trans_probs, attn_weights):
2199
+ def _get_prediction_details(self, input_text, mlp_probs, trans_probs, attn_weights, batch_size=2):
2199
2200
  show_details = self.pipeline.show_explainability_details
2200
2201
  if trans_probs.ndim == 1:
2201
2202
  trans_probs = trans_probs.reshape(1, -1)
@@ -2274,7 +2275,7 @@ class ExplainabilityModule:
2274
2275
  self.get_uncertain_predictions(details)
2275
2276
 
2276
2277
  if details['final_confidence'] < 0.15 and not self.pipeline.autonomous:
2277
- self.analyze_with_feedback(details, input_text, mlp_probs, trans_probs, attn_weights, explanation)
2278
+ self.analyze_with_feedback(details, input_text, mlp_probs, trans_probs, attn_weights, explanation, batch_size=2)
2278
2279
 
2279
2280
  confidence = self.explain_confidence(details)
2280
2281
  if final_conf:
@@ -7936,7 +7937,7 @@ class IntegratedPipeline:
7936
7937
  std_pool = np.std(sequence_inputs, axis=1)
7937
7938
  return np.concatenate([mean_pool, max_pool, std_pool], axis=-1)
7938
7939
 
7939
- def transformer_utilities(self, rules, datasets, X_raw):
7940
+ def transformer_utilities(self, rules, datasets, X_raw, batch_size=2):
7940
7941
  self.text_encoder(datasets)
7941
7942
  _, y_true = self.input_encoding(datasets)
7942
7943
  sequence_inputs = self.sequence_encoding(datasets)
@@ -7954,7 +7955,7 @@ class IntegratedPipeline:
7954
7955
  mode = 'fixed_backward'
7955
7956
 
7956
7957
  if self.use_transformer:
7957
- self.model2.train(sequence_inputs, y_true, epochs=100, mode=mode, lr=lr, embedded=True)
7958
+ self.model2.train(sequence_inputs, y_true, epochs=100, mode=mode, lr=lr, embedded=True, batch_size=batch_size)
7958
7959
 
7959
7960
  X_raw_generation, y, n_classes, input_dim = self.mlp_training_features(rules, datasets)
7960
7961
  X_raw_features = self.tfidf.transform(X_raw_generation).toarray()
@@ -9985,7 +9986,7 @@ class PipelinePredictionManager:
9985
9986
 
9986
9987
 
9987
9988
 
9988
- def regular_prediction_method(self, titles, label_map, rules, show_proba=False, top_k=3, use_transformer=True):
9989
+ def regular_prediction_method(self, titles, label_map, rules, show_proba=False, top_k=3, batch_size=2,use_transformer=True):
9989
9990
  try:
9990
9991
  print(f"\n[🚀] Regular Prediction for labels with {len(titles)} titles...")
9991
9992
  self.pipeline.titles = titles
@@ -9996,7 +9997,7 @@ class PipelinePredictionManager:
9996
9997
 
9997
9998
  dataset, X = self.pipeline.data_preparation(titles, label_map)
9998
9999
  _, y, _, _ = self.pipeline.mlp_training_features(rules, dataset)
9999
- self.pipeline.transformer_utilities(rules, dataset, X)
10000
+ self.pipeline.transformer_utilities(rules, dataset, X, batch_size=batch_size)
10000
10001
  input_ids, _ = self.pipeline.input_encoding(dataset)
10001
10002
 
10002
10003
 
@@ -10244,7 +10245,7 @@ class PipelinePredictionManager:
10244
10245
  # Only recalibrate if models disagreed AND we have valid results
10245
10246
  if results and not results[0].get('models_agree', True):
10246
10247
  print("\n[⚠️] Disagreement detected between MLP and Transformer predictions. Using calibrated probabilities for final decision.")
10247
- calibrated_probs = self.pipeline.hybrid_prediction(input_ids, X)
10248
+ calibrated_probs = self.pipeline.hybrid_prediction(input_ids, X, batch_size=batch_size)
10248
10249
 
10249
10250
  if calibrated_probs is not None and len(calibrated_probs) > 0:
10250
10251
  final_idx = int(np.argmax(calibrated_probs[:num_classes]))
@@ -10270,8 +10271,8 @@ class PipelinePredictionManager:
10270
10271
 
10271
10272
  return results
10272
10273
 
10273
- def hybrid_model_prediction(self, datasets, X_raw):
10274
- self.pipeline.transformer_utilities(datasets, X_raw)
10274
+ def hybrid_model_prediction(self, datasets, X_raw, batch_size=2):
10275
+ self.pipeline.transformer_utilities(datasets, X_raw, batch_size=batch_size)
10275
10276
  input_datasets = self.pipeline.transformer_input_encoding([i[0] for i in datasets])
10276
10277
 
10277
10278
  probs = self.model.predict_proba(input_datasets, X_raw, type='Hybrid')[0]
@@ -10279,7 +10280,7 @@ class PipelinePredictionManager:
10279
10280
 
10280
10281
  return probs, pred
10281
10282
 
10282
- def robust_prediction(self, pipeline, titles, label_map, show_proba=True, top_k=3):
10283
+ def robust_prediction(self, pipeline, titles, label_map, show_proba=True, top_k=3, batch_size=2):
10283
10284
  self.pipeline.titles = titles
10284
10285
  self.pipeline.labels = label_map
10285
10286
 
@@ -10288,10 +10289,10 @@ class PipelinePredictionManager:
10288
10289
  datasets, X_raw = self.pipeline.data_preparation(titles, label_map)
10289
10290
  reverse_map = {v: k for k, v in label_map.items()}
10290
10291
 
10291
- self.pipeline.transformer_utilities(datasets, X_raw)
10292
+ self.pipeline.transformer_utilities(datasets, X_raw, batch_size=batch_size)
10292
10293
  input_datasets = self.pipeline.transformer_input_encoding(datasets)
10293
10294
  pred_probs = self.pipeline.predict_proba(input_datasets, X_raw, type='Hybrid')[0]
10294
- pred_result = self.pipeline.hybrid_prediction(input_datasets, X_raw)
10295
+ pred_result = self.pipeline.hybrid_prediction(input_datasets, X_raw, batch_size=batch_size)
10295
10296
 
10296
10297
  print("\n[🔍] Prediction result structure:")
10297
10298
  print(f"[=] Type: {type(pred_result)}")
@@ -10487,7 +10488,8 @@ class PipelinePredictionManager:
10487
10488
  show_proba=False, top_k=3,
10488
10489
  use_transformer=True,
10489
10490
  return_attention=False,
10490
- save_results=True):
10491
+ save_results=True,
10492
+ batch_size=2):
10491
10493
  try:
10492
10494
  eps = 1e-5
10493
10495
  trans_probs = None
@@ -10504,7 +10506,7 @@ class PipelinePredictionManager:
10504
10506
 
10505
10507
  dataset, X = self.pipeline.data_preparation(titles, label_map)
10506
10508
  _, y, _, _ = self.pipeline.mlp_training_features(rules, dataset)
10507
- self.pipeline.transformer_utilities(rules, dataset, X)
10509
+ self.pipeline.transformer_utilities(rules, dataset, X, batch_size=batch_size)
10508
10510
  input_ids, _ = self.pipeline.input_encoding(dataset)
10509
10511
 
10510
10512
  if use_transformer and hasattr(self.pipeline, 'vocab') and self.pipeline.vocab:
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AbstractIntegratedModule
3
- Version: 0.2.1
4
- Summary: Advanced Integrated Non-LLM AI Module - Backend Framework for Non-LLM AI Agent Framework
3
+ Version: 0.2.2
4
+ Summary: Framework forAdvanced Integrated Non-LLM AI Module library - Backend Framework for Non-LLM AI Agent Framework
5
5
  Author: Micro-Novelty
6
6
  Author-email: hernikpuspita5@gmail.com
7
7
  License: MIT
@@ -40,7 +40,7 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
40
40
  #### Note: The README here you are reading is a direct copy from my README Repository, to download the necessary files, you can visit my Repository with the provided link above.
41
41
 
42
42
  ### Library Short Description:
43
- - Development Stage: Beta, 0.2.0.
43
+ - Development Stage: Beta, 0.2.2.
44
44
  - Maintainer: Micro-Novelty.
45
45
  - library Source-Code is Open-sourced on github.
46
46
  - Purpose: Specifically Designed for providing Non-LLM AI Agent Framework for edge Devices, Optimized for ARM64 architecture.
@@ -342,7 +342,8 @@ B. [=] Advanced Prediction without Transformer, Only Specialized MLP using AWE.
342
342
  ### Both performance Overview
343
343
  <img width="1536" height="1024" alt="WhatsApp Image 2026-05-24 at 10 27 00" src="https://github.com/user-attachments/assets/9404277f-281f-4893-8367-e494833230ea" />
344
344
 
345
- ## Source code of AbstractIntegratedModule
345
+ ## Source code of AbstractIntegratedModule
346
+ - Note: The source code is provided in the repository.
346
347
  - [=] Full Monolithic extensively-documented source code (12K+ Lines): [AbstractIntegratedPipeline-SourceCode.zip](AbstractIntegratedPipeline-SourceCode.zip)
347
348
  - [=] Separated Modules of AbstractIntegratedModule: [AbstractIntegratedModule-separated-modules](AbstractIntegratedModule-separated-modules)
348
349
  - [~] Note:
@@ -353,7 +354,21 @@ B. [=] Advanced Prediction without Transformer, Only Specialized MLP using AWE.
353
354
  - Commercialize it: Package, brand, and sell the software for profit.
354
355
 
355
356
  ## [=] Step's for in-depth Usage
356
- 1. Download:
357
+ 0. Download via PIP:
358
+ - Clone repository first:
359
+ ```bash
360
+ # Clone immediately for Windows and x86_64 only without prerequisites
361
+ git clone https://github.com/Micro-Novelty/IntegratedPipeline-Continous-Learning-AI-Agent-library-framework.git
362
+ cd IntegratedPipeline-Continous-Learning-AI-Agent-library-framework
363
+ ```
364
+
365
+ - Install the library via pip:
366
+ ```bash
367
+ pip install AbstractIntegratedModule #or
368
+ python -m pip install AbstractIntegratedModule
369
+ ```
370
+
371
+ 1. Download for binaries:
357
372
  - AbstractIntegratedModule.pyd (For Windows) (Python 3.13),
358
373
  - AbstractIntegratedModule.cpython-39-x86_64-linux-gnu.so (For linux x86_64) (Python 3.12)
359
374
  - AbstractIntegratedModule.cpython-39-aarch64-linux-gnu.so (for Linux ARM64 - Raspberry Pi) (Python 3.10)
@@ -518,8 +533,9 @@ B. [=] Advanced Prediction without Transformer, Only Specialized MLP using AWE.
518
533
  show_proba=False, top_k=3,
519
534
  use_transformer=True,
520
535
  return_attention=False,
521
- save_results=True)
522
-
536
+ save_results=True,
537
+ batch_size=2)
538
+ # batch size=2 is needed during transformer training for batching, if you have larger samples consider using batch_size > 8, for medium amount of samples (>10 -> <50 samples) consider using 2 or 4 batch_size.
523
539
  # ... more features you can add
524
540
  ```
525
541
 
@@ -8,7 +8,7 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
8
8
  #### Note: The README here you are reading is a direct copy from my README Repository, to download the necessary files, you can visit my Repository with the provided link above.
9
9
 
10
10
  ### Library Short Description:
11
- - Development Stage: Beta, 0.2.0.
11
+ - Development Stage: Beta, 0.2.2.
12
12
  - Maintainer: Micro-Novelty.
13
13
  - library Source-Code is Open-sourced on github.
14
14
  - Purpose: Specifically Designed for providing Non-LLM AI Agent Framework for edge Devices, Optimized for ARM64 architecture.
@@ -310,7 +310,8 @@ B. [=] Advanced Prediction without Transformer, Only Specialized MLP using AWE.
310
310
  ### Both performance Overview
311
311
  <img width="1536" height="1024" alt="WhatsApp Image 2026-05-24 at 10 27 00" src="https://github.com/user-attachments/assets/9404277f-281f-4893-8367-e494833230ea" />
312
312
 
313
- ## Source code of AbstractIntegratedModule
313
+ ## Source code of AbstractIntegratedModule
314
+ - Note: The source code is provided in the repository.
314
315
  - [=] Full Monolithic extensively-documented source code (12K+ Lines): [AbstractIntegratedPipeline-SourceCode.zip](AbstractIntegratedPipeline-SourceCode.zip)
315
316
  - [=] Separated Modules of AbstractIntegratedModule: [AbstractIntegratedModule-separated-modules](AbstractIntegratedModule-separated-modules)
316
317
  - [~] Note:
@@ -321,7 +322,21 @@ B. [=] Advanced Prediction without Transformer, Only Specialized MLP using AWE.
321
322
  - Commercialize it: Package, brand, and sell the software for profit.
322
323
 
323
324
  ## [=] Step's for in-depth Usage
324
- 1. Download:
325
+ 0. Download via PIP:
326
+ - Clone repository first:
327
+ ```bash
328
+ # Clone immediately for Windows and x86_64 only without prerequisites
329
+ git clone https://github.com/Micro-Novelty/IntegratedPipeline-Continous-Learning-AI-Agent-library-framework.git
330
+ cd IntegratedPipeline-Continous-Learning-AI-Agent-library-framework
331
+ ```
332
+
333
+ - Install the library via pip:
334
+ ```bash
335
+ pip install AbstractIntegratedModule #or
336
+ python -m pip install AbstractIntegratedModule
337
+ ```
338
+
339
+ 1. Download for binaries:
325
340
  - AbstractIntegratedModule.pyd (For Windows) (Python 3.13),
326
341
  - AbstractIntegratedModule.cpython-39-x86_64-linux-gnu.so (For linux x86_64) (Python 3.12)
327
342
  - AbstractIntegratedModule.cpython-39-aarch64-linux-gnu.so (for Linux ARM64 - Raspberry Pi) (Python 3.10)
@@ -486,8 +501,9 @@ B. [=] Advanced Prediction without Transformer, Only Specialized MLP using AWE.
486
501
  show_proba=False, top_k=3,
487
502
  use_transformer=True,
488
503
  return_attention=False,
489
- save_results=True)
490
-
504
+ save_results=True,
505
+ batch_size=2)
506
+ # batch size=2 is needed during transformer training for batching, if you have larger samples consider using batch_size > 8, for medium amount of samples (>10 -> <50 samples) consider using 2 or 4 batch_size.
491
507
  # ... more features you can add
492
508
  ```
493
509
 
@@ -3,8 +3,8 @@ from setuptools import setup
3
3
 
4
4
  setup(
5
5
  name="AbstractIntegratedModule",
6
- version="0.2.1",
7
- description="Advanced Integrated Non-LLM AI Module - Backend Framework for Non-LLM AI Agent Framework",
6
+ version="0.2.2",
7
+ description="Framework forAdvanced Integrated Non-LLM AI Module library - Backend Framework for Non-LLM AI Agent Framework",
8
8
  long_description=open("README.md", encoding="utf-8").read(),
9
9
  long_description_content_type="text/markdown",
10
10
  author="Micro-Novelty",