Skip to content

Commit

Permalink
Improvements (#308)
Browse files Browse the repository at this point in the history
* model-factory

* removed main.py from metadata extractor

* removed reduntant code - 1

* Model factory updates

* small fix

* initial implementation of attn based predicate extraction

* fixes to attn mechanism

* algo improve and removed prints

* deleted dead code

* fixed assertions in email tests

* removed prints
  • Loading branch information
ngupta10 committed Jun 10, 2024
1 parent 162fc22 commit cfa5344
Show file tree
Hide file tree
Showing 47 changed files with 1,703 additions and 1,970 deletions.
38 changes: 0 additions & 38 deletions querent/config/core/gpt_llm_config.py

This file was deleted.

7 changes: 3 additions & 4 deletions querent/config/core/llm_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from pydantic import BaseModel, Field
from typing import List, Dict, Any, Optional
import os

from querent.config.engine.engine_config import EngineConfig

class LLM_Config(EngineConfig):
Expand All @@ -11,11 +10,11 @@ class LLM_Config(EngineConfig):
description: str = "An engine for NER and knowledge graph operations."
version: str = "0.0.1"
logger: str = "LLM.engine_config"
ner_model_name: str = "dbmdz/bert-large-cased-finetuned-conll03-english"
ner_model_name: str = "English"
spacy_model_path: str = 'en_core_web_lg'
nltk_path: str = '/model/nltk_data'
rel_model_type: str = 'llama'
rel_model_path: str = './tests/llama-2-7b-chat.Q5_K_M.gguf'
rel_model_type: str = 'bert'
rel_model_path: str = 'bert-base-uncased'
grammar_file_path: str = './querent/kg/rel_helperfunctions/json.gbnf'
emb_model_name: str = 'sentence-transformers/all-MiniLM-L6-v2'
user_context: str = Field(default="In a semantic triple (Subject, Predicate & Object) framework, determine which of the above entity is the subject and which is the object based on the context along with the predicate between these entities. Please also identify the subject type, object type & predicate type.")
Expand Down
2 changes: 1 addition & 1 deletion querent/config/core/opensource_llm_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Opensource_LLM_Config(BaseModel):
version: str = "0.0.1"
logger: str = "RelationshipExtractor.engine_config"
model_type: str = 'llama'
model_path: str = './tests/llama-2-7b-chat.Q5_K_M.gguf'
model_path: str = ''
grammar_file_path: str = './querent/kg/rel_helperfunctions/json.gbnf'
qa_template: str = Field(default=None)
emb_model_name: str = 'sentence-transformers/all-MiniLM-L6-v2'
Expand Down
426 changes: 291 additions & 135 deletions querent/core/transformers/bert_ner_opensourcellm.py

Large diffs are not rendered by default.

195 changes: 0 additions & 195 deletions querent/core/transformers/fixed_entities_set_opensourcellm.py

This file was deleted.

Loading

0 comments on commit cfa5344

Please sign in to comment.