I have tried something like this:

from sentence_transformers import SentenceTransformer
import itertools
from sklearn.feature_extraction.text import CountVectorizer
import torch
from sentence_transformers.util import cos_sim

# Load the model
model = SentenceTransformer("valurank/MiniLM-L6-Keyword-Extraction")

# Your sentences
sentences = [
    """Thank you for calling me to see now for speaking. Can I assist you? I need access to a site, please. Glam key number? Charlie Papa 87. Charlie Papa 87. 87. Speaking to Leon. Leon, yeah. Site number? 353380. 353380. Site number three five double three eight oh three five double three eight oh, yeah, I'm going to the main listening. No, I'm saying how long? How long? Give us two hours, please. All right, you cannot make sure to close any of that. I'll do that. Thank you. All right, thank you. Bye. Bye-bye.""",
    """Thank you for calling me to see now for speaking. Can I assist you? I need access to a site, please. Glam key number? Charlie Papa 87...""",
    """Thank you for calling it to see you through to Vivian. May I assist you? Hi Vivian, how are you? I'm good, thanks. How are you? I'm okay..."""
]

# Function to get candidate keywords using N-grams
def get_candidate_keywords(sentences, ngram_range=(1, 3)):
    vectorizer = CountVectorizer(ngram_range=ngram_range, stop_words='english').fit(sentences)
    candidate_keywords = vectorizer.get_feature_names_out()
    return candidate_keywords

# Encode the sentences
sentence_embeddings = model.encode(sentences, convert_to_tensor=True)

# Get candidate keywords
candidate_keywords = get_candidate_keywords(sentences)

# Encode candidate keywords
keyword_embeddings = model.encode(candidate_keywords, convert_to_tensor=True)

# Function to extract keywords for a sentence
def extract_keywords_for_sentence(sentence_embedding, keyword_embeddings, candidate_keywords, top_n=10):
    # Compute cosine similarity between the sentence and keyword embeddings
    similarities = cos_sim(sentence_embedding, keyword_embeddings)[0]
    
    # Get the top N keywords with highest similarity scores
    top_k = min(top_n, len(candidate_keywords))
    top_keywords = torch.topk(similarities, k=top_k)
    
    keywords = []
    for score, idx in zip(top_keywords.values, top_keywords.indices):
        keywords.append((candidate_keywords[idx], score.item()))
    return keywords

# Extract keywords for each sentence
for idx, sentence_embedding in enumerate(sentence_embeddings):
    keywords = extract_keywords_for_sentence(sentence_embedding, keyword_embeddings, candidate_keywords, top_n=10)
    print(f"Sentence {idx+1}:\n{sentences[idx]}\n")
    print("Extracted Keywords:")
    for keyword, score in keywords:
        print(f"{keyword} ({score:.4f})")
    print('-' * 80)


but all i need it for the transcribed calls to match it to a service in this list:



### APPLIANCES  
- APPLIANCES  
- Fixed Systems  
- Water Dispensers / Coffee Rentals  

---


---

### MECHANICAL UNITS  
- MECHANICAL UNITS  
- MECHANIOCAL UNITS (typo)  
- Maintenance Significant Equipment  
- Welding Equipment  
- Lab Extraction Cabinets  
- General Equipment  
- Vehicle Equipment  
- Vacuum System  
- Pressure System  

---

### ALTERNATIVE POWER  
- ALTERNATIVE POWER  

---

### WATER RETICULATION  
- WATER RETICULATION  
- Water Reticulation  
- Grey Water System  

---

### GENERAL INFRASTRUCTURE  
- GENERAL INFRASTRUCTURE  
- GENERAL INFASTRUCTURE (typo)  
- GENERAL INFRASTRUTURE (typo)  
- GENERAL INFRUSTRUCTURE (typo)  
- General Infrastracture (typo)  
- Medium Voltage  
- ACCOMMODATION  
- Structure  

---

### UNINTERRUPTED POWER SYSTEM  
- UNINTERRUPTED POWER SYSTEM  
- UNINTERRUPTED POWER  

---

### DIRECT CURRENT POWER  
- DIRECT CURRENT POWER  

---

### STOREROOM  
- STOREROOM  

---

### CABLE PRESSURISATION AND DEHYDRATION  
- CABLE PRESSURISATION AND DEHYDRATION  

---

### FIRE  
- FIRE  
- Fire Protection Services  
- Fire Suppression Systems  
- Access Control  

---

### SOFT SERVICES  
- SOFT SERVICES  
- SOFT SERVICE (typo)  
- SOFT SERVCES (typo)  

---

### WORKPLACE SERVICES  
- WORKPLACE SERVICES  
- WORKPLACE SERVICE (typo)  

---

### HVAC / HVACR  
- HVAC  
- HVACR  

---

### SECURITY  
- SECURITY  
- Access Control  

---

### VEHICLES  
- VEHICLES  

---

### OTHER CATEGORIES  
- Remote Monitoring  
- Safety Health and Environment  
- Air Conditioning  
- Air-Conditioning  
- Electrical  
- General Building Services  
- Medium Voltage  
- Absa Locker  
- Warehouse  
- Custom  
- SAB Chamdor  
- Welding  

Here’s a categorization of the subservices you provided, grouped based on their general functions or domains:

---

### **1. Facilities and Infrastructure**  
**(Related to building management, construction, and structural elements)**  
- BLOCK A CASUAL SEATING SOCIAL FF ZONE 1  
- BLOCK D QUESTION DOCUMENTS UNIT SECOND F  
- BLOCK G SHOOTING RANGE AND GARAGES BASEM  
- CONCRETE TOWERS  
- STEEL STRUCTURES  
- BRICK AND MORTAR BUILDING  
- ARCHIVING  
- WAREHOUSING  
- MANHOLES  
- BUILDING FABRIC  

---

### **2. HVAC & Climate Control**  
**(Heating, ventilation, air-conditioning, and climate systems)**  
- AIR CONDITIONING / AIR-CONDITIONING / AIRCONDITIONING  
- VENTILATION / SMOKE VENTILATION AND EXTRACTION  
- HEATING  
- FIXED SYSTEMS  
- LAB EXTRACTION CABINETS  
- COOLING AND VENTILATION  

---

### **3. Electrical Systems and Power Supply**  
**(Power systems, backup solutions, and energy supply)**  
- UNINTERRUPTED POWER SYSTEM / UNITERRUPTED POWER SYSTEM  
- EMERGENCY POWER / EMERGENCY POWER SYSTEM  
- SOLAR ENERGY / SOLAR STRUCTURES  
- DIRECT CURRENT POWER  
- MAIN SUPPLY  
- INVERTER SYSTEM  
- RECTIFIER  
- PRIME POWER SYSTEMS  
- POWER CUBE  
- DC SYSTEMS / DC CABINET / DC DISTRIBUTION BOARD  

---

### **4. Fire Protection & Safety Systems**  
**(Fire suppression and emergency safety)**  
- FIRE UNINTERRUPTED POWER SYSTEM  
- FIRE HYDRANT SYSTEM / FIRE HYDRANDT SYSTEMS  
- FIXED APPLIANCES  
- SPECIAL SUPPRESSION  
- ADDRESSABLE DETECTION SYSTEM  
- DETECTION  
- FIRE  
- EMERGENCY SHOWERS  
- FIRST AID KIT  

---

### **5. Security and Access Control**  
**(Security equipment and access control systems)**  
- ACCESS PREVENTION  
- STANDALONE ACCESS CONTROL SYSTEMS  
- NETWORK ACCESS CONTROL SYSTEMS  
- INTEL CABINET  
- INTRUDER DETECTION AND ALARM  
- VEHICLE RECOGNITION SYSTEM  

---

### **6. Cleaning, Hygiene, and Waste Management**  
**(Sanitation, cleaning, and waste handling)**  
- CLEANING / CLEANING SERVICES / CLEANING - BUILDING INTERIOR  
- HYGIENE / HYGIENE SERVICES  
- WASTE MANAGEMENT  
- VACUUM TUBE SYSTEM  

---

### **7. Transportation and Logistics**  
**(Movement of goods and personnel)**  
- VEHICLES  
- LIFT / LIFTS AND ESCALATORS  
- TRANSPORTATION  
- JIG  
- BUSH CLEARING  

---

### **8. Catering and Kitchen Equipment**  
**(Food services and cooking appliances)**  
- CATERING / BIDVEST CATERING EQUINOX DRY STORES  
- KITCHEN APPLIANCES / KITCHEN APLIANCES  
- COFFEE  
- OVEN  

---

### **9. Mechanical and Industrial Equipment**  
**(Equipment used in industrial processes or mechanical systems)**  
- LIFTING / HOIST EQUIPMENT  
- MILLING  
- GRIT BLASTING SYSTEM  
- LOAD TESTING BENCH  
- MECHANICAL UNIT / MECHANICAL UNITS  

---

### **10. Environmental and Landscaping**  
**(Outdoor services, plants, and environmental maintenance)**  
- INTERNAL PLANTS / OFFICE PLANTS / INDOOR PLANTS  
- GARDENING AND GROUND MAINTENANCE  
- WATER FEATURE  
- BUSH CLEARING  

---

### **11. Plumbing and Water Systems**  
**(Water supply, plumbing, and drainage systems)**  
- PLUMBING / PLUMBIMG  
- DOMESTIC WATER  
- SEPTIC TANK  
- STORM WATER, SEWERAGE AND DRAINAGE  
- WATER TEST PUMP  

---

### **12. Office and Furniture Management**  
**(Office equipment and workspace setup)**  
- OFFICE FURNITURE  
- CHURN AND FURNITURE  
- TELAFIT SYSTEM (RAIL CAR)  
- ROWA ARCHIVE SYSTEM  


### APPLIANCES  
- APPLIANCES  
- Fixed Systems  
- Water Dispensers / Coffee Rentals  

---


---

### MECHANICAL UNITS  
- MECHANICAL UNITS  
- MECHANIOCAL UNITS (typo)  
- Maintenance Significant Equipment  
- Welding Equipment  
- Lab Extraction Cabinets  
- General Equipment  
- Vehicle Equipment  
- Vacuum System  
- Pressure System  

---

### ALTERNATIVE POWER  
- ALTERNATIVE POWER  

---

### WATER RETICULATION  
- WATER RETICULATION  
- Water Reticulation  
- Grey Water System  

---

### GENERAL INFRASTRUCTURE  
- GENERAL INFRASTRUCTURE  
- GENERAL INFASTRUCTURE (typo)  
- GENERAL INFRASTRUTURE (typo)  
- GENERAL INFRUSTRUCTURE (typo)  
- General Infrastracture (typo)  
- Medium Voltage  
- ACCOMMODATION  
- Structure  

---

### UNINTERRUPTED POWER SYSTEM  
- UNINTERRUPTED POWER SYSTEM  
- UNINTERRUPTED POWER  

---

### DIRECT CURRENT POWER  
- DIRECT CURRENT POWER  

---

### STOREROOM  
- STOREROOM  

---

### CABLE PRESSURISATION AND DEHYDRATION  
- CABLE PRESSURISATION AND DEHYDRATION  

---

### FIRE  
- FIRE  
- Fire Protection Services  
- Fire Suppression Systems  
- Access Control  

---

### SOFT SERVICES  
- SOFT SERVICES  
- SOFT SERVICE (typo)  
- SOFT SERVCES (typo)  

---

### WORKPLACE SERVICES  
- WORKPLACE SERVICES  
- WORKPLACE SERVICE (typo)  

---

### HVAC / HVACR  
- HVAC  
- HVACR  

---

### SECURITY  
- SECURITY  
- Access Control  

---

### VEHICLES  
- VEHICLES  

---

### OTHER CATEGORIES  
- Remote Monitoring  
- Safety Health and Environment  
- Air Conditioning  
- Air-Conditioning  
- Electrical  
- General Building Services  
- Medium Voltage  
- Absa Locker  
- Warehouse  
- Custom  
- SAB Chamdor  
- Welding  

Here’s a categorization of the subservices you provided, grouped based on their general functions or domains:

---

### **1. Facilities and Infrastructure**  
**(Related to building management, construction, and structural elements)**  
- BLOCK A CASUAL SEATING SOCIAL FF ZONE 1  
- BLOCK D QUESTION DOCUMENTS UNIT SECOND F  
- BLOCK G SHOOTING RANGE AND GARAGES BASEM  
- CONCRETE TOWERS  
- STEEL STRUCTURES  
- BRICK AND MORTAR BUILDING  
- ARCHIVING  
- WAREHOUSING  
- MANHOLES  
- BUILDING FABRIC  

---

### **2. HVAC & Climate Control**  
**(Heating, ventilation, air-conditioning, and climate systems)**  
- AIR CONDITIONING / AIR-CONDITIONING / AIRCONDITIONING  
- VENTILATION / SMOKE VENTILATION AND EXTRACTION  
- HEATING  
- FIXED SYSTEMS  
- LAB EXTRACTION CABINETS  
- COOLING AND VENTILATION  

---

### **3. Electrical Systems and Power Supply**  
**(Power systems, backup solutions, and energy supply)**  
- UNINTERRUPTED POWER SYSTEM / UNITERRUPTED POWER SYSTEM  
- EMERGENCY POWER / EMERGENCY POWER SYSTEM  
- SOLAR ENERGY / SOLAR STRUCTURES  
- DIRECT CURRENT POWER  
- MAIN SUPPLY  
- INVERTER SYSTEM  
- RECTIFIER  
- PRIME POWER SYSTEMS  
- POWER CUBE  
- DC SYSTEMS / DC CABINET / DC DISTRIBUTION BOARD  

---

### **4. Fire Protection & Safety Systems**  
**(Fire suppression and emergency safety)**  
- FIRE UNINTERRUPTED POWER SYSTEM  
- FIRE HYDRANT SYSTEM / FIRE HYDRANDT SYSTEMS  
- FIXED APPLIANCES  
- SPECIAL SUPPRESSION  
- ADDRESSABLE DETECTION SYSTEM  
- DETECTION  
- FIRE  
- EMERGENCY SHOWERS  
- FIRST AID KIT  

---

### **5. Security and Access Control**  
**(Security equipment and access control systems)**  
- ACCESS PREVENTION  
- STANDALONE ACCESS CONTROL SYSTEMS  
- NETWORK ACCESS CONTROL SYSTEMS  
- INTEL CABINET  
- INTRUDER DETECTION AND ALARM  
- VEHICLE RECOGNITION SYSTEM  

---

### **6. Cleaning, Hygiene, and Waste Management**  
**(Sanitation, cleaning, and waste handling)**  
- CLEANING / CLEANING SERVICES / CLEANING - BUILDING INTERIOR  
- HYGIENE / HYGIENE SERVICES  
- WASTE MANAGEMENT  
- VACUUM TUBE SYSTEM  

---

### **7. Transportation and Logistics**  
**(Movement of goods and personnel)**  
- VEHICLES  
- LIFT / LIFTS AND ESCALATORS  
- TRANSPORTATION  
- JIG  
- BUSH CLEARING  

---

### **8. Catering and Kitchen Equipment**  
**(Food services and cooking appliances)**  
- CATERING / BIDVEST CATERING EQUINOX DRY STORES  
- KITCHEN APPLIANCES / KITCHEN APLIANCES  
- COFFEE  
- OVEN  

---

### **9. Mechanical and Industrial Equipment**  
**(Equipment used in industrial processes or mechanical systems)**  
- LIFTING / HOIST EQUIPMENT  
- MILLING  
- GRIT BLASTING SYSTEM  
- LOAD TESTING BENCH  
- MECHANICAL UNIT / MECHANICAL UNITS  

---

### **10. Environmental and Landscaping**  
**(Outdoor services, plants, and environmental maintenance)**  
- INTERNAL PLANTS / OFFICE PLANTS / INDOOR PLANTS  
- GARDENING AND GROUND MAINTENANCE  
- WATER FEATURE  
- BUSH CLEARING  

---

### **11. Plumbing and Water Systems**  
**(Water supply, plumbing, and drainage systems)**  
- PLUMBING / PLUMBIMG  
- DOMESTIC WATER  
- SEPTIC TANK  
- STORM WATER, SEWERAGE AND DRAINAGE  
- WATER TEST PUMP  

---

### **12. Office and Furniture Management**  
**(Office equipment and workspace setup)**  
- OFFICE FURNITURE  
- CHURN AND FURNITURE  
- TELAFIT SYSTEM (RAIL CAR)  
- ROWA ARCHIVE SYSTEM