ThreatLevelD
commited on
Commit
·
3dfb7ca
1
Parent(s):
ee2273a
Added EILProcessor core module
Browse files- core/eil_processor.py +26 -0
- core/input_preprocessor.py +21 -0
- main.py +31 -1
core/eil_processor.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# core/eil_processor.py
|
| 2 |
+
# Master Emotional Core (MEC) - EIL Processor
|
| 3 |
+
|
| 4 |
+
class EILProcessor:
|
| 5 |
+
def __init__(self):
|
| 6 |
+
pass # No config needed for MVP starter
|
| 7 |
+
|
| 8 |
+
def process_eil(self, preprocessing_packet):
|
| 9 |
+
normalized_text = preprocessing_packet.get("normalized_text", "")
|
| 10 |
+
|
| 11 |
+
# Placeholder logic for MVP:
|
| 12 |
+
# Split into phrases, tag as candidates
|
| 13 |
+
phrases = normalized_text.split(".") # Very simple split
|
| 14 |
+
|
| 15 |
+
eil_packet = {
|
| 16 |
+
"phrases": phrases,
|
| 17 |
+
"emotion_candidates": [
|
| 18 |
+
{"phrase": p.strip(), "candidate_emotion": "Pending"} for p in phrases if p.strip()
|
| 19 |
+
],
|
| 20 |
+
"metadata": {
|
| 21 |
+
"source": "InputPreprocessor"
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
print(f"[EILProcessor] Packet: {eil_packet}")
|
| 26 |
+
return eil_packet
|
core/input_preprocessor.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# core/input_preprocessor.py
|
| 2 |
+
# Master Emotional Core (MEC) - Input Preprocessor
|
| 3 |
+
|
| 4 |
+
class InputPreprocessor:
|
| 5 |
+
def __init__(self, signal_floor=0.2, max_token_length=1024, enable_noise_filter=True):
|
| 6 |
+
self.signal_floor = signal_floor
|
| 7 |
+
self.max_token_length = max_token_length
|
| 8 |
+
self.enable_noise_filter = enable_noise_filter
|
| 9 |
+
|
| 10 |
+
def preprocess_text(self, raw_text):
|
| 11 |
+
# Basic text normalization placeholder
|
| 12 |
+
normalized_text = raw_text.strip().lower()
|
| 13 |
+
# Simulate preprocessing packet
|
| 14 |
+
preprocessing_packet = {
|
| 15 |
+
"normalized_text": normalized_text,
|
| 16 |
+
"length": len(normalized_text)
|
| 17 |
+
}
|
| 18 |
+
print(f"[InputPreprocessor] Packet: {preprocessing_packet}")
|
| 19 |
+
return preprocessing_packet
|
| 20 |
+
|
| 21 |
+
# Audio and video preprocessing would be added here in full system
|
main.py
CHANGED
|
@@ -4,4 +4,34 @@
|
|
| 4 |
print("MEC MVP Test Runner")
|
| 5 |
print("System ready — modules loading...")
|
| 6 |
|
| 7 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
print("MEC MVP Test Runner")
|
| 5 |
print("System ready — modules loading...")
|
| 6 |
|
| 7 |
+
# 1️⃣ Import modules
|
| 8 |
+
from core.input_preprocessor import InputPreprocessor
|
| 9 |
+
from core.eil_processor import EILProcessor
|
| 10 |
+
# Future imports:
|
| 11 |
+
# from core.esil_inference import ESILInference
|
| 12 |
+
# from core.confidence_gate import ConfidenceGate
|
| 13 |
+
# from core.hei_inference import HEIInference
|
| 14 |
+
# from core.eris_reasoner import ERISReasoner
|
| 15 |
+
# from core.uesp_constructor import UESPConstructor
|
| 16 |
+
# from core.fec_controller import FECController
|
| 17 |
+
|
| 18 |
+
# 2️⃣ Initialize modules
|
| 19 |
+
preprocessor = InputPreprocessor()
|
| 20 |
+
print("[Main] Input Preprocessor initialized.")
|
| 21 |
+
|
| 22 |
+
# 3️⃣ Run test pipeline
|
| 23 |
+
test_input = "I’m feeling really overwhelmed today"
|
| 24 |
+
preprocessing_packet = preprocessor.preprocess_text(test_input)
|
| 25 |
+
|
| 26 |
+
# 4️⃣ Print packet for debug
|
| 27 |
+
print("\n[Main] Pipeline Output:")
|
| 28 |
+
print(f"Input: {test_input}")
|
| 29 |
+
print(f"Preprocessing Packet: {preprocessing_packet}")
|
| 30 |
+
|
| 31 |
+
# Run EIL processing
|
| 32 |
+
eil_processor = EILProcessor()
|
| 33 |
+
eil_packet = eil_processor.process_eil(preprocessing_packet)
|
| 34 |
+
# Run EIL processing
|
| 35 |
+
|
| 36 |
+
# Print EIL packet
|
| 37 |
+
print(f"\n[Main] EIL Packet Output: {eil_packet}")
|