superml icon indicating copy to clipboard operation
superml copied to clipboard

Bug in SuperML BM_25 in SQL Server

Open maximilian22x opened this issue 10 months ago • 0 comments

Hello, I tried to use BM_25 (R-Version) inside the SQL Server 2022 and I notice a bug.

If I use BM_25 in SQL Server then I got only one column as output (score) but not the corresponding docs.

ALTER PROC reports.PROC_2                   
as 

 DECLARE @Rscript NVARCHAR(MAX) = N'

 library(superml)
 
 docs <- c("Kaufmann", "test")

 sentence <- "Kaufmann"

 s <- bm_25(document = sentence, corpus = docs, top_n=10)

 OutputDataSet <- as.data.frame(s)

 OutputDataSet
 
 ' ;

EXEC sp_execute_external_script                      @language     = N'R',
     @script       = @Rscript
GO

EXEC reports.PROC_2 'Kaufmann'  
(No column name)
0,693147180559945
0

If I execute the same code in VS Code then I got two columns (docs, score) as output. Very weird. Do someone understand why this happen?

maximilian22x avatar Mar 30 '24 20:03 maximilian22x