-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SAND Entity Editor UI, when users link new cell, it will automaticall…
…y do an initial search using the cell as the query to save users time from re-entering the same information.
- Loading branch information
Binh Vu
committed
Apr 13, 2024
1 parent
145a713
commit 3f4d049
Showing
9 changed files
with
77 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[tool.poetry] | ||
name = "sand-grams" | ||
version = "1.0.0" | ||
description = "SAND & GRAMS Integration" | ||
authors = ["Binh Vu <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from __future__ import annotations | ||
|
||
from dependency_injector.wiring import Provide, inject | ||
|
||
from sand.config import AppConfig | ||
from sand.extension_interface.assistant import IAssistant | ||
from sand.helpers.namespace import NamespaceService | ||
from sand.models.table import Link, Table, TableRow | ||
|
||
|
||
class GRAMSAssistant(IAssistant): | ||
|
||
@inject | ||
def __init__( | ||
self, | ||
appcfg: AppConfig = Provide["appcfg"], | ||
namespace: NamespaceService = Provide["namespace"], | ||
): | ||
self.appcfg = appcfg | ||
self.namespace = namespace | ||
|
||
# def predict_entities( | ||
# self, table: Table, rows: list[TableRow], row: int, col: int | ||
# ) -> list[Link]: | ||
# text = str(rows[row].row[col]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
from __future__ import annotations | ||
|
||
from abc import ABC, abstractmethod | ||
from typing import TYPE_CHECKING, List, Optional, Tuple | ||
from typing import Optional | ||
|
||
from sand.models.table import Table, TableRow | ||
from sm.outputs.semantic_model import SemanticModel | ||
|
||
if TYPE_CHECKING: | ||
from sand.app import App | ||
from sand.models.table import Link, Table, TableRow | ||
|
||
|
||
class IAssistant(ABC): | ||
def __init__(self, app: App): | ||
self.app = app | ||
|
||
@abstractmethod | ||
class IAssistant: | ||
def predict( | ||
self, table: Table, rows: List[TableRow] | ||
) -> Tuple[Optional[SemanticModel], Optional[List[TableRow]]]: | ||
self, table: Table, rows: list[TableRow] | ||
) -> tuple[Optional[SemanticModel], Optional[list[TableRow]]]: | ||
"""Predict semantic model and link entities""" | ||
pass | ||
raise NotImplementedError() | ||
|
||
def predict_entities( | ||
self, table: Table, rows: list[TableRow], row: int, col: int | ||
) -> list[Link]: | ||
"""Predict entities for a cell""" | ||
raise NotImplementedError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters