Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-lperezra committed Dec 21, 2024
1 parent 236c120 commit 84fcd6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 2 additions & 4 deletions encoder-ui/src/app/analysis/analysis.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,11 @@ export class AnalysisComponent implements OnInit{
}

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

textHTML = textHTML.replace(text, "<mark>"+text+"</mark>");
textHTML = textHTML.replace(regEx, "<mark>"+text+"</mark>");
this.textUpdated = textHTML;
}

Expand Down
6 changes: 3 additions & 3 deletions encoder-ui/src/app/analyzer/analyzer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class AnalyzerComponent {
var textHTML = this.textToAnalyze?.value;
var textOriginal = textHTML;
var textToProcess = this.textToAnalyze?.value.split(".").filter(Boolean);
var piecedTextToProcess: any[] = [textOriginal];
var piecedTextToProcess: any[] = textToProcess;

var forReading = 100/(piecedTextToProcess.length);
this.totalReceived = 0;
Expand Down Expand Up @@ -117,11 +117,11 @@ export class AnalyzerComponent {
}

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

textHTML = textHTML.replace(text, "<mark>"+text+"</mark>");
textHTML = textHTML.replace(regEx, "<mark>"+text+"</mark>");
this.textUpdated = textHTML;
}

Expand Down
3 changes: 1 addition & 2 deletions src/ENCODER/BP/AnalyzeTextProcess.cls
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ Method AnalyzeText(text As %String, analysisId As %String, language As %String)
{
import sentence_transformers
import iris
import spacy
import requests

try:
url = "http://ollama:11434/api/generate"
data = {
"model": "llama3.2",
"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,
"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,
"stream": False
}
response = requests.post(url, json=data)
Expand Down

0 comments on commit 84fcd6d

Please sign in to comment.