The database is responsible for keeping track of sentences, entity mentions, and entity indices.
The database contains the following tables:
Contains each sentence from all input text. Has a unique sid
.
Represents each entity mention from all input text. Has sid
as foreign key (a sentence must exist for the entitymention to exist).
Used by the Entity Linker to find potential matches for a given entity mention. See Entity Linker Docs for more information.
async def InitializeIndexDB(dbPath):
some/path/to/a/Database/directory
.async def Insert(dbPath, tableName, queryInformation):
some/path/to/a/Database/directory
.{
"fileName": "article.txt",
"string": "A duck walked across the road",
"startindex": 20,
"endIndex": 29
}
Would be a valid insert in the sentence
table.
NOTE: The
sid
is autogenerated usingAUTOINCREMENT
.
async def Read(dbPath, tableName, searchPred=""):
some/path/to/a/Database/directory
.searchPred
= Jones
and the tableName
= entitymention
, the entitymention table will be searched for Jones
.async def Update(dbPath, tableName, indexID, updatedName):
some/path/to/a/Database/directory
.sid
, eid
or id
(EntityIndex) to update.string
, mention
or name
should be updated to.async def Delete(dbPath, tableName, indexID):
some/path/to/a/Database/directory
.sid
, eid
or id
(EntityIndex) to delete.