Commit d94169eb authored by Alexander Lercher's avatar Alexander Lercher

Semantic Linking: working semantic linking logic without integration

parent b365f613
import networkx as nx
import matplotlib.pyplot as plt
from collections import Counter
import initialdemo.HyperGraph as hg
import HyperGraph as hg
import pandas as pd
import json
import warnings
......@@ -12,6 +12,13 @@ import mplleaflet
import values as values
from matplotlib import colors
# pip install networkx
# pip install matplotlib
# pip install pandas
# pip install community
# pip install mplleaflet
# pip install values
class SemanticLinking:
def __init__(self):
......@@ -100,6 +107,7 @@ class SemanticLinking:
weight1 = []
node_adjacencies = []
labeling = {}
def drawedges(self):
......@@ -116,7 +124,7 @@ class SemanticLinking:
self.G.__setattr__('weight', self.weight1)
def labeling(self):
def dolabeling(self):
"""label_propagation_communities(G) """
......@@ -201,7 +209,7 @@ class SemanticLinking:
def main(self):
self.drawedges()
self.labeling()
self.dolabeling()
self.findigneighbors()
self.result()
......
......@@ -2,16 +2,13 @@ import json
import requests
from threading import Thread
import network_constants as netconst
from intelligence_zahra.Processor import Processor
import logging
LOGGER = logging.getLogger(__name__)
class MessageHandler:
_processor: Processor = None
def __init__(self):
self._processor = Processor()
pass
def handle_generic(self, body):
LOGGER.info(f"Received message: {body}")
......@@ -43,6 +40,7 @@ class MessageHandler:
if response.status_code == 200:
traces = response.json()
Thread(target=self._processor.process(traces)).start()
# TODO integrate zahras code
# Thread(target=self._processor.process(traces)).start()
else:
LOGGER.error(f"Could not retrieve JSON from {url} with GET request ({response.status_code})")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment