Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
order-splitter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dzptm
order-splitter
Commits
80018fc3
Commit
80018fc3
authored
4 years ago
by
Joni Krebs
Browse files
Options
Downloads
Patches
Plain Diff
added postprocessiong for questions to fix some common mistakes
parent
7ec023a7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/kotlin/de/dzptm/server/Extractor.kt
+11
-1
11 additions, 1 deletion
src/main/kotlin/de/dzptm/server/Extractor.kt
with
11 additions
and
1 deletion
src/main/kotlin/de/dzptm/server/Extractor.kt
+
11
−
1
View file @
80018fc3
...
...
@@ -8,6 +8,7 @@ import org.apache.uima.cas.CAS
import
org.apache.uima.util.CasCreationUtils
import
spark.Request
import
spark.Response
import
java.util.regex.Pattern
object
Extractor
{
fun
extract
(
req
:
Request
,
res
:
Response
):
String
{
...
...
@@ -36,7 +37,7 @@ object Extractor {
modality
=
modality
,
anamnesis
=
anamnesis
,
diagnosis
=
anamnesis
,
question
=
question
,
question
=
postProcessQuestion
(
question
)
,
notice
=
""
,
pregnancy
=
pregnancy
,
pregnancy_week
=
""
,
...
...
@@ -98,6 +99,15 @@ object Extractor {
return
"nicht erhoben"
}
private
fun
postProcessQuestion
(
question
:
String
):
String
{
val
pattern
=
Pattern
.
compile
(
"(?i)(termin|vielen dank)"
)
val
matcher
=
pattern
.
matcher
(
question
)
if
(
matcher
.
find
())
{
return
question
.
substring
(
0
,
matcher
.
start
()).
trim
()
}
return
question
}
private
fun
getAnamnesisQuestionFromPython
(
doctext
:
String
):
Pair
<
String
,
String
>
{
val
url
=
"http://localhost:$pythonPort/predict"
try
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment