Skip to content

Commit

Permalink
Testing performance
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-lperezra committed Aug 26, 2024
1 parent ff200f5 commit 6ba7974
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ENCODER/BP/AnalyzeTextProcess.cls
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ Method AnalyzeText(text As %String, analysisId As %String, language As %String)
embeddingList = embeddings.tolist()
i = 0
for text in texts:
iris.cls("Ens.Util.Log").LogInfo("ENCODER.BP.AnalyzeTextProcess", "AnalyzeText", text)
sqlsentence = "INSERT INTO ENCODER_Object.TextMatches (CodeId, Description, Similarity, AnalysisId, RawText) SELECT * FROM (SELECT CodeId, Description, VECTOR_DOT_PRODUCT(VectorDescription, TO_VECTOR('"+str(embeddingList[i])+"', DECIMAL)) AS Similarity, '"+analysisId+"', '"+text+"' FROM ENCODER_Object.Codes) WHERE Similarity > 0.8"
#iris.cls("Ens.Util.Log").LogInfo("ENCODER.BP.AnalyzeTextProcess", "AnalyzeText", sqlsentence)
iris.cls("ENCODER.Utils.Manager").ExecuteInsertQuery(sqlsentence)
iris.cls("Ens.Util.Log").LogInfo("ENCODER.BP.AnalyzeTextProcess", "AnalyzeText", "Sentence finished")

i = i + 1
except Exception as err:
return repr(err)
Expand Down

0 comments on commit 6ba7974

Please sign in to comment.