diff --git a/concept_linking/data/files/EvaluationData/evaluationSet_EN_small.json b/concept_linking/data/files/EvaluationData/evaluationSet_EN_small.json index 45437d7..f04fa69 100644 --- a/concept_linking/data/files/EvaluationData/evaluationSet_EN_small.json +++ b/concept_linking/data/files/EvaluationData/evaluationSet_EN_small.json @@ -19,17 +19,17 @@ ] }, { - "sentence": "Michelle Obama is an person.", + "sentence": "Michelle Obama is a person.", "sentenceStartIndex": 0, - "sentenceEndIndex": 24, + "sentenceEndIndex": 26, "entityMentions": [ { - "name": "Barack Obama", + "name": "Michelle Obama", "type": "Entity", "label": "PERSON", "startIndex": 0, - "endIndex": 11, - "iri": "knox-kb01.srv.aau.dk/Barack_Obama" + "endIndex": 13, + "iri": "knox-kb01.srv.aau.dk/Michelle_Obama" } ] } diff --git a/concept_linking/main.py b/concept_linking/main.py index 3e4a310..e9c7253 100644 --- a/concept_linking/main.py +++ b/concept_linking/main.py @@ -14,10 +14,10 @@ def entity_type_classification(input_data): #stringComparisonSolution(input_data) # Untrained Spacy - #untrainedSpacySolution(input_data) + untrainedSpacySolution(input_data) # PromptEngineering - perform_entity_type_classification(input_data) + #perform_entity_type_classification(input_data) # Machine Learning #predict(input_data) diff --git a/concept_linking/solutions/PromptEngineering/main.py b/concept_linking/solutions/PromptEngineering/main.py index 074a227..51ae026 100644 --- a/concept_linking/solutions/PromptEngineering/main.py +++ b/concept_linking/solutions/PromptEngineering/main.py @@ -14,6 +14,8 @@ # Local API url docker # api_url = "http://llama-cpu-server:5000/llama" + + # Remote API url # api_url = "http://knox-proxy01.srv.aau.dk/llama-api/llama" diff --git a/concept_linking/solutions/StringComparison/utils.py b/concept_linking/solutions/StringComparison/utils.py index dd04793..262328e 100644 --- a/concept_linking/solutions/StringComparison/utils.py +++ b/concept_linking/solutions/StringComparison/utils.py @@ -14,8 +14,6 @@ def translateWordToEn(word, language): from difflib import SequenceMatcher - - # returnerer en konstant mellem 0 og 1. 0 er et elendigt match, 1 er et eksakt match. def similar(a, b): return SequenceMatcher(None, a.lower(), b.lower()).ratio() diff --git a/relation_extraction/relation_extractor.py b/relation_extraction/relation_extractor.py index b9de9b8..5fb3d4f 100644 --- a/relation_extraction/relation_extractor.py +++ b/relation_extraction/relation_extractor.py @@ -1,8 +1,9 @@ # from relation_extraction.NaiveMVP.main import handle_relation_post_request +from relation_extraction.NaiveMVP.main import handle_relation_post_request from relation_extraction.multilingual.main import begin_relation_extraction class RelationExtractor(): @classmethod def begin_extraction(self, data): - # handle_relation_post_request(data) # Naive solution + handle_relation_post_request(data) # Naive solution begin_relation_extraction(data) # Multilingual solution diff --git a/test/test_server/test_server.py b/test/test_server/test_server.py index f4e8340..f94607d 100644 --- a/test/test_server/test_server.py +++ b/test/test_server/test_server.py @@ -10,8 +10,8 @@ def setUp(self): # Valid: authorized and correct format @patch('os.getenv', return_value="some_api_secret") # @patch('concept_linking.main.stringComparisonSolution', return_value=Mock()) - # @patch('concept_linking.main.untrainedSpacySolution', return_value=Mock()) - @patch('concept_linking.main.perform_entity_type_classification', return_value=Mock()) + @patch('concept_linking.main.untrainedSpacySolution', return_value=Mock()) + # @patch('concept_linking.main.perform_entity_type_classification', return_value=Mock()) # @patch('concept_linking.main.predict', return_value=Mock()) @patch('relation_extraction.relation_extractor.RelationExtractor.begin_extraction', return_value=Mock())