Skip to content

Commit 84fcd6d

Browse files
committed
Minor updates
1 parent 236c120 commit 84fcd6d

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

encoder-ui/src/app/analysis/analysis.component.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,11 @@ export class AnalysisComponent implements OnInit{
113113
}
114114

115115
markDiagnosis(text: string) {
116-
var regex = /[.,;:¿?!¡\(\)-]/g;
116+
var regEx = new RegExp(text.trim(), "ig");
117117
this.unmarkDiagnosis();
118118
var textHTML = this.textToMark;
119-
var phrase = "";
120-
var indexInit = 0;
121119

122-
textHTML = textHTML.replace(text, "<mark>"+text+"</mark>");
120+
textHTML = textHTML.replace(regEx, "<mark>"+text+"</mark>");
123121
this.textUpdated = textHTML;
124122
}
125123

encoder-ui/src/app/analyzer/analyzer.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class AnalyzerComponent {
5353
var textHTML = this.textToAnalyze?.value;
5454
var textOriginal = textHTML;
5555
var textToProcess = this.textToAnalyze?.value.split(".").filter(Boolean);
56-
var piecedTextToProcess: any[] = [textOriginal];
56+
var piecedTextToProcess: any[] = textToProcess;
5757

5858
var forReading = 100/(piecedTextToProcess.length);
5959
this.totalReceived = 0;
@@ -117,11 +117,11 @@ export class AnalyzerComponent {
117117
}
118118

119119
markDiagnosis(text: String) {
120-
var regex = /[.,;:¿?!¡\(\)-]/g;
120+
var regEx = new RegExp(text.trim(), "ig");
121121
this.unmarkDiagnosis();
122122
var textHTML = this.textToAnalyze?.value;
123123

124-
textHTML = textHTML.replace(text, "<mark>"+text+"</mark>");
124+
textHTML = textHTML.replace(regEx, "<mark>"+text+"</mark>");
125125
this.textUpdated = textHTML;
126126
}
127127

src/ENCODER/BP/AnalyzeTextProcess.cls

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ Method AnalyzeText(text As %String, analysisId As %String, language As %String)
1414
{
1515
import sentence_transformers
1616
import iris
17-
import spacy
1817
import requests
1918

2019
try:
2120
url = "http://ollama:11434/api/generate"
2221
data = {
2322
"model": "llama3.2",
24-
"prompt": "Extrae en formato CSV el texto literal de los diagnósticos encontrados en el paciente del siguiente texto sin mostrar diagnósticos que no se observen ni para los que no hay hallazgos patológicos, devuelve únicamente el CSV, evita fórmulas de cortesía: "+text,
23+
"prompt": "Extrae en formato CSV los diagnósticos encontrados en el paciente del siguiente texto sin mostrar diagnósticos que no se observen ni para los que no hay hallazgos patológicos, evita fórmulas de cortesía: "+text,
2524
"stream": False
2625
}
2726
response = requests.post(url, json=data)

0 commit comments

Comments
 (0)