-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
These are two issues related to each other.
-
we have a rudimentary process "classifier" here which is right now based on string match, which does not account for conflicting key terms within one sentence (but this has also not been crucial/used by anyone in a while). Any suggestions on how to improve that?
-
We are trying to extract planting areas (
PlantingArea). Planting areas are not always explicitly marked (they are just referred to asareas). Other types of areas, on the other hand, frequently have indicators, e.g., irrigation and weed areas below.
- Four scores , corresponding to four classes of surface area coverage by weeds , were distinguished : 0 for none ; 1 for weak ( less than 10 % of surface area coverage by weeds ) ; 2 for strong ( between 10 and 30 % ) ; 3 for very strong ( more than 30 % of surface area coverage by weeds ) .
- This type of irrigation scheme ( or perimeter ) , with an area of below 50 ha and cultivated by farmers from a single village , covers about 25 % of the irrigated area on the two banks of the Senegal River ( SAED , 1997 ; SONADER , 1998 ) .
One thing we could try is to extract any available areas (with label AreaAssignment or smth like that) and distinguish between them using the context attachment. Thoughts?
- make a separate class for processing lemmas as recommended by @kwalcock:
case class ProcessToLemmas(process: String, lemmas: Set[String]) {
def this(processAndLemmas: (String, Set[String])) = this(processAndLemmas._1, processAndLemmas._2)
}
// These are prioritized highest to lowest because there can be multiple matches.
val processToLemmasMap = Seq(
"planting" -> Set("plant", "sow", "cultivate", "cultivation", "grow"),
"harvest" -> Set("harvest", "yield"),
"credit" -> Set("credit", "finance", "value"),
"irrigation" -> Set("irrigation", "irrigate"),
"weeds" -> Set("weed"),
"natural_disaster" -> Set("flood", "bird", "attack")
).map(new ProcessToLemmas(_)) // just for convenience
def getProcess(mention: Mention): String = {
val lemmas = mention.sentenceObj.lemmas.get
val process = processToLemmasMap
.find { processToLemmas =>
lemmas.exists(processToLemmas.lemmas)
}
.map(_.process)
.getOrElse("UNK")
process
}Metadata
Metadata
Assignees
Labels
No labels