Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Wiki Rasa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
tm-chatbot
Wiki Rasa
Commits
f9bb700c
Commit
f9bb700c
authored
6 years ago
by
Lukas Gehrke
Browse files
Options
Downloads
Patches
Plain Diff
Adds check for date as birthplace.
parent
ccf459e7
No related branches found
Branches containing commit
No related tags found
1 merge request
!52
Resolve: "Refactor get_birthplace.R to get_nationality.R"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
processing/wikiproc/R/get_birthplace.R
+6
-6
6 additions, 6 deletions
processing/wikiproc/R/get_birthplace.R
with
6 additions
and
6 deletions
processing/wikiproc/R/get_birthplace.R
+
6
−
6
View file @
f9bb700c
...
...
@@ -13,7 +13,6 @@
#' @return String with birthplace of the physicist|NA
get_birthplace
<-
function
(
article
,
annotations
)
{
# If there is no infobox we return 0
if
(
grepl
(
"vcard"
,
article
))
{
# Use infobox to get Birthplace
...
...
@@ -31,7 +30,7 @@ get_birthplace <- function(article, annotations) {
}
else
{
# Try to extract birthplace from text as first NORP entitiy
# Not
beautiful
, because it mostly is Nationality of the physicist
# Not
very effective
, because it mostly is Nationality of the physicist
# - Get named entities
# - Get NORP entities
# - Get first NORP
...
...
@@ -44,10 +43,11 @@ get_birthplace <- function(article, annotations) {
# Trim whitespaces
birthplace
<-
trimws
(
birthplace
)
# Return birthplace or NA
if
(
!
is.null
(
birthplace
))
{
return
(
birthplace
)
}
else
{
# Return NA if birthplace is a date or "0"
if
(
grep
(
"\\d"
,
birthplace
)
==
1
)
{
return
(
NA
)
}
else
{
return
(
birthplace
)
}
}
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