Views
No views yet
dataprocess.py: Preprocesses HDFS log files, extracts log messages, groups them by block ID, and tokenizes sequences for model input.train.py: Trains the LogBERT model using Masked Log Word Prediction (MLWP) and KL divergence tasks for anomaly detection.answerdotai/ModernBERT-base model, enhanced with modern architectural improvements like Rotary Positional Embeddings (RoPE) and Flash Attention for long-context processing.huggingface)pip install torch transformers pandas numpy scikit-learn1git clone https://huggingface.co/MingtongDu/ModernLogBERT
2cd ModernLogBERTHDFS.log) and anomaly label file (e.g., anomaly_label.csv) in an accessible directory.dataprocess.py and train.py to match your environment.train.py.ep165.pt). Update the CHECKPOINT_PATH in train.py to point to your checkpoint file.dataprocess.py to parse, tokenize, and save the processed datasets:python dataprocess.pyHDFS.log to extract log messages and block IDs.anomaly_label.csv.train.pt, val.pt, and test.pt in the specified output directory.train.py to train the LogBERT model:python train.pyEP3_froze21.pt.dataprocess.py: MAX_LENGTH, TRAIN_RATIO, VAL_RATIO, TEST_RATIO, PRINT_SAMPLES, RANDOM_SEED.train.py: BATCH_SIZE, NUM_EPOCHS, LEARNING_RATE, NUM_LAYERS_TO_FREEZE, DROPOUT_RATE, MASK_PROB, ALPHA, G, R.dataprocess.py: Script for log parsing, label loading, grouping, tokenization, and data saving.train.py: Script for loading data, defining the LogBERT model, and training with anomaly detection metrics.output/: Directory containing processed datasets (train.pt, val.pt, test.pt) and the saved tokenizer.saved_model/: Directory for saving the trained model checkpoint.ModernLogBERT: Mingtong Du and Haoran Li. https://huggingface.co/MingtongDu/ModernLogBERT
LICENSE file for details.