Skip to content

Instantly share code, notes, and snippets.

View pateelhs's full-sized avatar

Pateel H S pateelhs

  • Agiledge process solutions Pvt Ltd
View GitHub Profile
@pateelhs
pateelhs / Plan
Last active April 5, 2024 04:26
Alert Standardisation
Conduct an Audit of Existing Alerts
Gather a comprehensive list of all alerts currently being generated across different systems and applications.
Identify the source, trigger conditions, severity levels, and any additional metadata associated with each alert.
Analyze the alerts to identify redundancies, overlaps, or inconsistencies in how they are defined or categorized.
Establish Alert Classification Taxonomy
Define a standardized taxonomy for classifying alerts based on factors such as:
System/Application: Categorize alerts by the system or application they originate from.
Alert Type: Classify alerts based on their nature (e.g., performance, security, availability, etc.).
Severity Level: Establish consistent severity levels (e.g., critical, high, medium, low) based on the impact and urgency.
Business Impact: Categorize alerts based on their potential impact on business operations, revenue, or customer experience.
@pateelhs
pateelhs / streamlit_link_search.py
Last active March 8, 2024 04:59
label with link
@pateelhs
pateelhs / 4*4.html
Last active March 1, 2024 15:14
Jinja template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>4x4 Grid Template</title>
<style>
table {
width: 100%;
border-collapse: collapse;
@pateelhs
pateelhs / comp_group.py
Last active February 27, 2024 07:32
comprehend-it
import pandas as pd
from transformers import pipeline
# Initialize the pipeline
classifier = pipeline("zero-shot-classification", model="knowledgator/comprehend_it-base")
# Define your candidate labels
labels = ["Access", "Build", "Enhancement","Decommission","Backup and Restore","Optimization","Patching"] # Replace these with your labels
# Load data
@pateelhs
pateelhs / zero.py
Created February 23, 2024 05:42
Zero Shot
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
from collections import Counter
from transformers import pipeline
# Initialize the zero-shot classifier
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
# Define the possible labels
@pateelhs
pateelhs / kmeans.py
Created February 15, 2024 17:24
PREDEFINED LABELS
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from transformers import BertTokenizer, BertForSequenceClassification
from sklearn.cluster import KMeans
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import logging
import torch
@pateelhs
pateelhs / bert_keyword.py
Last active February 15, 2024 16:33
Bert stem and keyword New
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from transformers import BertTokenizer, BertForSequenceClassification
from sklearn.cluster import DBSCAN
from nltk.tokenize import word_tokenize,sent_tokenize
from nltk.corpus import stopwords
import logging
import torch
@pateelhs
pateelhs / bert_labels.py
Created February 15, 2024 07:06
Bert labels
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from transformers import BertTokenizer, BertForSequenceClassification
from sklearn.cluster import DBSCAN
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import logging
import torch
@pateelhs
pateelhs / clustering.py
Created February 14, 2024 09:44
DBSCAN With LOGS
# clustering.py
from sklearn.cluster import DBSCAN
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
def cluster_tickets_advanced(tfidf_matrix, min_samples=5, eps=0.5):
dbscan = DBSCAN(eps=eps, min_samples=min_samples, metric='cosine')
clusters = dbscan.fit_predict(tfidf_matrix)
@pateelhs
pateelhs / OnlyPlot.py
Last active February 14, 2024 09:00
Find and Plot the Num_clusters
import pandas as pd
import numpy as np
from sklearn.cluster import KMeans
from transformers import BertTokenizer, BertModel
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
import matplotlib.pyplot as plt
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords