ml
- ml.FitAndPredict(path)
Splits and trains a KNN model to classify the article embeddings. Before splitting into train-test sets it will seperate the articles fetched from the news API to be predicted after testing which will be saved to a seprate file.
- Parameters:
path (str) – the directory of data such as the ttl file and the article list
- ml.get_embeddings(ttl_path, entities)
Use the RDF2Vec algorithm to produce the embedding vectors, first it must load the KG, then using the randomwalker it will create the embeddings by using the pyRDF2Vec package