Merge branch 'main' of https://github.com/stuartgo/anansyTypes
This commit is contained in:
commit
ce7e57d1c1
3 files changed
+6
-31
No files matched your search
@@ -26,6 +26,7 @@ __all__ = [
|
||||
"PreprocessorType",
|
||||
"SymbolProvider",
|
||||
"Language",
|
||||
"DiscountType",
|
||||
"Currency",
|
||||
"SubscriptionType"
|
||||
]
|
||||
|
||||
@@ -52,4 +52,8 @@ class SubscriptionType(Enum):
|
||||
class Currency(Enum):
|
||||
EUR = "EUR"
|
||||
USD = "USD"
|
||||
NOK = "NOK"
|
||||
NOK = "NOK"
|
||||
|
||||
class DiscountType(Enum):
|
||||
PERCENTAGE = "percentage"
|
||||
ABSOLUTE = "absolute"
|
||||
@@ -8,25 +8,6 @@ from .embedding import Embedding
|
||||
import numpy as np
|
||||
|
||||
|
||||
# class NoEmbeddingPhrase(Lexeme):
|
||||
# def __init__(self, id: str, content: str,original_content: str):
|
||||
# #initialised with empty embedding
|
||||
# super().__init__(id=id, content=content, embedding=Embedding(data=torch.tensor([])), original_content=original_content)
|
||||
|
||||
# @classmethod
|
||||
# def from_dict(cls, data: dict) -> "NoEmbeddingPhrase":
|
||||
# return cls(
|
||||
# id=data["id"],
|
||||
# content=data["content"],
|
||||
# original_content=data["original_content"],
|
||||
# )
|
||||
# @model_validator(mode="before")
|
||||
# @classmethod
|
||||
# def ignore_embedding(cls, values):
|
||||
# # Remove embedding from incoming data
|
||||
# values.pop("embedding", None)
|
||||
# return values
|
||||
|
||||
class Phrase(Lexeme):
|
||||
|
||||
@classmethod
|
||||
@@ -37,14 +18,3 @@ class Phrase(Lexeme):
|
||||
original_content=data["original_content"],
|
||||
embedding=Embedding.from_dict(data["embedding"]),
|
||||
)
|
||||
|
||||
# @classmethod
|
||||
# def from_noembeddingphrase(
|
||||
# cls, phrase: NoEmbeddingPhrase, embedding: Embedding
|
||||
# ) -> "Phrase":
|
||||
# return cls(
|
||||
# id=phrase.id,
|
||||
# content=phrase.content,
|
||||
# original_content=phrase.original_content,
|
||||
# embedding=embedding,
|
||||
# )
|
||||
Reference in new issue
Block a user