Skip to content

Commit

Permalink
fix: Added new OpenAI Models
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethEnevoldsen committed Jan 28, 2024
1 parent dd24d3c commit e096ef5
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/seb/cache/text-embedding-3-large/DKHate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"task_name":"DKHate","task_description":"Danish Tweets annotated for Hate Speech either being Offensive or not","task_version":"1.1.1","time_of_run":"2024-01-28T10:53:53.76809","scores":{"da":{"accuracy":0.7021276595744681,"f1":0.5866916779285358,"ap":0.2156853854421142,"accuracy_stderr":0.051168657778769513,"f1_stderr":0.03375163473496878,"ap_stderr":0.025853930203666622,"main_score":0.7021276595744681}},"main_score":"accuracy"}
1 change: 1 addition & 0 deletions src/seb/cache/text-embedding-3-large/SweFAQ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"task_name":"SweFAQ","task_description":"A Swedish QA dataset derived from FAQ","task_version":"0.0.1","time_of_run":"2024-01-28T10:53:20.991871","scores":{"sv":{"ndcg_at_1":0.66862,"ndcg_at_3":0.77831,"ndcg_at_5":0.80088,"ndcg_at_10":0.81622,"ndcg_at_100":0.82568,"ndcg_at_1000":0.82621,"map_at_1":0.66862,"map_at_3":0.75211,"map_at_5":0.76468,"map_at_10":0.77114,"map_at_100":0.77336,"map_at_1000":0.77339,"recall_at_1":0.66862,"recall_at_3":0.8538,"recall_at_5":0.90838,"recall_at_10":0.95517,"recall_at_100":0.9961,"recall_at_1000":1.0,"precision_at_1":0.66862,"precision_at_3":0.2846,"precision_at_5":0.18168,"precision_at_10":0.09552,"precision_at_100":0.00996,"precision_at_1000":0.001,"mrr_at_1":0.66862,"mrr_at_3":0.75211,"mrr_at_5":0.76468,"mrr_at_10":0.77114,"mrr_at_100":0.77336,"mrr_at_1000":0.77339}},"main_score":"ndcg_at_10"}
1 change: 1 addition & 0 deletions src/seb/cache/text-embedding-3-small/DKHate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"task_name":"DKHate","task_description":"Danish Tweets annotated for Hate Speech either being Offensive or not","task_version":"1.1.1","time_of_run":"2024-01-28T10:51:19.574828","scores":{"da":{"accuracy":0.6556231003039514,"f1":0.5337929519129335,"ap":0.9049189781455185,"accuracy_stderr":0.06915210921608644,"f1_stderr":0.0409305947057325,"ap_stderr":0.012717360804567965,"main_score":0.6556231003039514}},"main_score":"accuracy"}
1 change: 1 addition & 0 deletions src/seb/cache/text-embedding-3-small/SweFAQ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"task_name":"SweFAQ","task_description":"A Swedish QA dataset derived from FAQ","task_version":"0.0.1","time_of_run":"2024-01-28T10:50:53.668451","scores":{"sv":{"ndcg_at_1":0.57505,"ndcg_at_3":0.68924,"ndcg_at_5":0.71952,"ndcg_at_10":0.73898,"ndcg_at_100":0.7592,"ndcg_at_1000":0.7613,"map_at_1":0.57505,"map_at_3":0.66309,"map_at_5":0.67976,"map_at_10":0.6881,"map_at_100":0.69291,"map_at_1000":0.69301,"recall_at_1":0.57505,"recall_at_3":0.76413,"recall_at_5":0.83821,"recall_at_10":0.89669,"recall_at_100":0.98441,"recall_at_1000":1.0,"precision_at_1":0.57505,"precision_at_3":0.25471,"precision_at_5":0.16764,"precision_at_10":0.08967,"precision_at_100":0.00984,"precision_at_1000":0.001,"mrr_at_1":0.57505,"mrr_at_3":0.66309,"mrr_at_5":0.67976,"mrr_at_10":0.6881,"mrr_at_100":0.69291,"mrr_at_1000":0.69301}},"main_score":"ndcg_at_10"}
34 changes: 34 additions & 0 deletions src/seb/registered_models/openai_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,37 @@ def create_openai_ada_002() -> EmbeddingModel:
loader=partial(OpenaiTextEmbeddingModel, api_name=api_name),
meta=meta,
)


@models.register("text-embedding-3-small")
def create_openai_3_small() -> EmbeddingModel:
api_name = "text-embedding-3-small"
meta = ModelMeta(
name=api_name,
huggingface_name=None,
reference="https://openai.com/blog/new-and-improved-embedding-model",
languages=[],
open_source=False,
embedding_size=1536,
)
return EmbeddingModel(
loader=partial(OpenaiTextEmbeddingModel, api_name=api_name),
meta=meta,
)


@models.register("text-embedding-3-large")
def create_openai_3_large() -> EmbeddingModel:
api_name = "text-embedding-3-large"
meta = ModelMeta(
name=api_name,
huggingface_name=None,
reference="https://openai.com/blog/new-and-improved-embedding-model",
languages=[],
open_source=False,
embedding_size=3072,
)
return EmbeddingModel(
loader=partial(OpenaiTextEmbeddingModel, api_name=api_name),
meta=meta,
)

0 comments on commit e096ef5

Please sign in to comment.