Professional Documents
Culture Documents
Highly Relevant Search Result Ranking For Large Law Enforcement Information Sharing Systems
Highly Relevant Search Result Ranking For Large Law Enforcement Information Sharing Systems
Police car photo by davidsonscott15 (Scott Davidson) on Flickr under (CC BY 2.0) license
3 interesting challenges:
Many factors affect relevance for a law-enforcement user A mix of structured, unstructured, semi-structured data Improving edismax sub-phrase boosting
Conclusion
Solr's flexibility & community are both great.
My Background
Ron Mayer CTO of Forensic Logic, Inc
We power crime analysis and cross-agency search tools for the LEAP (law enforcement analysis portal) project. About 150 State, Local, and Federal law enforcement agencies use our SAAS software to analyze and share data
My background
8 years of delivering software technologies to law enforcement as SAAS solutions. Use some F/OSS, quite a bit of proprietary. Play well with F/OSS projects
(contributed back code to PostgreSQL, PostGIS, a memcached client, and earlier contributions from school that found their way into various projects)
The Challenge
Problem I set out to solve
We had a good but complex database-based crime analysis package for investigators with good computer skills. Needed an easy google-like interface that any officer could use.
Considerations
Most officers don't want to sit around on desks filling out search forms. Want something like Google type a guess, and get the most relevant documents on the first page.
Project background
Project background
Started 8 years ago with a desktop Crime Analysis Application; ported to web application
Big structured search forms worked well for crime analysts and detectives who can invest time at a desk Some users wanted quicker/easier simple search
Project background
Prototyped with Project Blacklight
Wonderful F/OSS community Just added to their facet list in a config file. Constructuve feedback from customers in couple weeks.
Project background
Eventually rewrote with many law-enforcementcentric features.
'red baseball cap black leather jacket tall male suspect short asian victim' These search clauses are often noun clauses with a few adjectives preceding a noun; but are often independent from each other.
Geospatial factors
Officers are often interested in things near their own city or beat
Solr does this one well for 1 location of interest in a document:
bf=... recip(dist(2,primary_latlon,vector(#{lat},#{lon})),1,1,1)^0.5
I haven't yet found a great solution for documents with many locations of interest (say, a document regarding a gang importing drugs from Ciudad Jurez Mexico to Denver, which should be highly relevant to every city touching the southern half of I25.
Often law enforcement officers want to search for documents near a certain type of landmark
near any elementary school in the school district near a particular school in a predominantly Hispanic neighborhood near a freeway
Sometimes more convenient to interact with a map and use Solr's geospatial features. Sometimes more convenient to tag the documents with the relevant phrases.
Not having a lot of luck with Solr/Lucene here yet Often intersecting polygons.
Just off a I5 Walking distance from a Jr High School
Temporal factors
Absolute time: Recent documents are often more interesting than very old documents.
Solr handles this well with
Dismax's bf=recip(ms(NOW,primary_date),3.16e-11,1,1)^2 ... Edismax's boost=recip(ms(NOW,primary_date),3.16e-11,1,1)&boost= (unless you have expressions that can hit 0, edismax's multiplicative boost seem easier to balance against other boosting factors)
Relative time: Gang retaliations often happen near each other in time.
Can replace NOW in the above with some other date of interest.
Time of day: Certain robbers and burglars like to work at certain times of the day (payday after work; dusk; at Raider's games).
Can handle as a range facet, and/or by tagging documents with phrases for text search
A search for John Doe should rank documents where he's the Arrestee (or subject, etc) over those where he's an innocent bystander (or witness or victim, etc). Handled nicely by Solr's Dismax and edismax qf=important_text^2 less_important_text feature
Important parts of a document can depend a lot on the content of a document itself.
For a sexual assault, characteristics of a victim like the victim's age and gender can be very "important", while the make/model of her car will be unimportant. For a vehicle theft, the age and gender of the victim will be more unimportant while make/model of the car will be more important. Handled reasonably by having logic in the indexer to place some data into different text fields; and by having the app server tweak the boosts in the qf= expression as needed
Handled with the dismax: bf=sqrt(importance) parameter and similar edismax boost= paramters
Exact matches with text from the source document is weighted more than speculative guesses from our algorithms.
We tag documents with additional terms that weren't necessarily in the source document.
Some of this is done by Solr
Stemming Synonyms
But these additional tags carry less weight in ranking than the source document.
The Lucene SweetSpotSimilarity feature seems to be give nicer results than the old default. We're experimenting with our own that may work better with our mixed-structured-unstructured content.
Disparate data
City
County
Law Enforcement
City
County
City
County
XML, etc?
Or course! And the best part is there are many to choose from :) Many federal efforts
GJXDM (Global Justice XML Data Model) 1.0, 2.0, 3.0.3 (2005) NIEM (outgrowth of GJXDM + DHS(FBI) + ODNI) NIEM 1.0 (2006) NIEM2.0 (2007) 2.1 (2009) LEXS extends subsets of NIEM EDXL (DHS, EIC) Emergency Data Exchange Language Not really designed for law enforcement, but with data relevant to police, and less US-centric in person names and addresses. And many States define their own XML standards. (which are often Extensions to NIEM Subsets like the Texas Path to NIEM)
But many of our data sources aren't that ready to adopt federal standards.
Small cities who's record management system is a folder of word documents. Old mainframe computers where every developer has retired Even when agencies using standardized XML, the most interesting content's not in the structured part.
The first suspect is described as a tall, heavyset, light skinned black male, possibly half Italian, with 2 inch knots or dreads in his hair with a light brown mustache. He was in possession of a small caliber handgun.
But many of our data sources aren't that ready to adopt federal standards. And some never will.
'tall red haired blue eyed teen male with dragon tattoo' 'Johnnie Doe dallas' 'Burglar broke rear bedroom window, stole jewelry'
users
'tall blue eyed teen male with dragon tattoo' 'Johnnie Doe red hair dallas'
...
Solution:
Convert XML to English.
Jonathan Doe, a tall (6'4) red haired blue eyed teen (17 year old) white male of Dallas TX was arrested at 1 Main St at 0456 Jan 1, 1999 (1999-01-01 04:56.) Possible nicknames, johnny, william, bill, billy ...
* NIEM is a large government XML standard often used for law enforcement information exchange. Much of our data is sent to us in this format or closely related ones; and for other data sources we map it to NIEM as as early part of our import pipeline.
33
34
Examples:
If an exact phrase matches, it's probably the document he's looking for. If a single paragraph contains all the words of a user's search, it's probably relevant too.
35
Examples:
Document text: The suspect was a tall thin teen male wearing a red baseball cap and black leather jacket Quite relevant for searches for black jacket, tall male, leather jacket, etc.
36
Solution
SOLR-2058 ...&pf2=text^10~10&pf=text^100&pf=text~100 your constants may change depending how much you weigh other boosting factors like document age or distance
37
38
Had an interesting conversation with one of this conference's sponsors about looking at the grammar to see which color goes with which noun.
39
Wrap Up
Law Enforcement has some pretty interesting challenges for finding the most relevant document. Solr's a very nice tool for companies to get started with text search and tuning it for domain specific needs; thanks to nice projects already using it, and a very helpful community. Solr's flexibility makes it easy to configure to even quite demanding requirements.
40
41
Sources
Resource
http://leap.nctcog.org
Links
https://issues.apache.org/jira/browse/SOLR-2058 https://github.com/ramayer/lucenesolr/tree/solr_2058_edismax_pf2_phrase_slop
White paper
42
Contact
Ron Mayer
ramayer@forensiclogic.com
43