Skip to content

Commit

Permalink
add dbPath to env
Browse files Browse the repository at this point in the history
  • Loading branch information
FredTheNoob committed Dec 8, 2023
1 parent 06e32df commit e442dc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions components/EntityLinker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
from lib.Entity import Entity
from fuzzywuzzy import fuzz


async def entitylinkerFunc(entities: List[Entity], threshold:int=80):
async def entitylinkerFunc(entities: List[Entity], db_path: str, threshold:int=80):
iri_dict = {}
linked_entities = []
db_path = "./Database/DB.db"
for entity in entities:
if entity.type == "Literal":
linked_entities.append(EntityLinked(entity, ""))
Expand Down
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
PIPELINE_C_URL = str(os.getenv("PIPELINE_C_URL"))
PIPELINE_C_AUTHORIZATION = str(os.getenv("PIPELINE_C_AUTHORIZATION"))
ACCESS_API_AUTHORIZATION = str(os.getenv("ACCESS_API_AUTHORIZATION"))
DB_PATH = str(os.getenv("DB_PATH"))

async def newFileCreated(file_path: str):
try:
Expand Down Expand Up @@ -120,12 +121,13 @@ async def processInput(file_path: str = "Artikel.txt"):
ents = GetSpacyData.GetEntities(doc) # construct entities from text

await Db.InitializeIndexDB(
"./Database/DB.db"
DB_PATH
) # makes the DB containing the entities of KG
# Returns JSON object containing an array of entity links

entLinks = await entitylinkerFunc(
ents
ents,
DB_PATH
) # Returns JSON object containing an array of entity links

entsJSON = GetSpacyData.BuildJSONFromEntities(entLinks, doc, file_path)
Expand Down

0 comments on commit e442dc4

Please sign in to comment.