<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Search Nuggets &#187; property extraction</title>
	<atom:link href="http://blog.comperiosearch.com/blog/tag/property-extraction/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.comperiosearch.com</link>
	<description>A blog about Search as THE solution</description>
	<lastBuildDate>Mon, 13 Jun 2016 08:59:45 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>Property Extraction in FS4SP</title>
		<link>http://blog.comperiosearch.com/blog/2011/03/02/property-extraction-fs4sp/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/03/02/property-extraction-fs4sp/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 07:40:04 +0000</pubDate>
		<dc:creator><![CDATA[Trond Øivind Eriksen]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[enterprise search]]></category>
		<category><![CDATA[fs4sp]]></category>
		<category><![CDATA[property extraction]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/?p=271</guid>
		<description><![CDATA[Property extraction (previously called entity extraction in FAST ESP) is a process that extracts information from the visible textual content of an item and stores that information as additional crawled properties for the document. In this blog post I will show how this can be automated in any given FAST Search for SharePoint installation. But [...]]]></description>
				<content:encoded><![CDATA[<p>Property extraction (previously called <em>entity extraction</em> in FAST ESP) is a process that extracts information from the visible textual content of an item and stores that information as additional crawled properties for the document.</p>
<p>In this blog post I will show how this can be automated in any given FAST Search for SharePoint installation. But first, just a short introduction to the extractors that we have out of the box:</p>
<ul>
<li><strong>Companies</strong> &#8211; extracts company names based on a generic dictionary.</li>
<li><strong>Locations</strong> &#8211; extracts names of geographical locations based on a generic dictionary.</li>
<li><strong>Person names</strong> &#8211; extracts names of persons based on a generic dictionary.</li>
</ul>
<p>In most cases, you will have companies, locations and person names that are specific to your company or organization. However, you may want to modify the built-in property extractors by adding inclusion lists and exclusion lists to improve the quality of these extractors. Typically you can use customer lists from your CRM system, employee information from your ERP system, and product listings you might have.</p>
<p>In order to accomplish this in an easy manner, we need some PowerShell magic.</p>
<p>First, just a quick overview of the input paramenters to the script:</p><pre class="crayon-plain-tag">.\PropertyExtraction.ps1 -file [fileName] -type [companies|personnames|locations] -addto [include|exclude]</pre><p>where the <em>file</em> parameter is the list of properties to extract, the <em>type</em> parameter specifies which property we&#8217;re dealing with and the <em>addto</em> parameter sets if the properties will be added to the include list or the exclude list.</p>
<p>Below is a snippet of where the fun takes place in code.</p><pre class="crayon-plain-tag">function ImportEntities()
{
    #Setting term entity dictionary to be &quot;companies&quot;, &quot;locations&quot; or &quot;personnames&quot;
    $entityExtractorContext = New-Object -TypeName Microsoft.SharePoint.Search.Extended.Administration.EntityExtractorContext
    $entityExtractors = $entityExtractorContext.TermEntityExtractors
    foreach ($extractor in $entityExtractors)
    {
        if ($extractor.Name -eq $type)
        {
            $entityExtractor = $extractor
            log VERBOSE &quot;Setting extractor to: $type&quot;
        }
    }

	log VERBOSE &quot;Reading file: $file&quot;
	try{ $input = Get-Content $file }
	catch{ log ERROR &quot;Failed to read file: $file&quot;}

    #Iterating over properties dictionary and adding them if they haven't been added before
    $input = Get-Content $file
    foreach($entity in $input)
    {
        if ($addto -eq &quot;include&quot;)
		{
			if ( $entityExtractor.Inclusions.Contains($entity) )
	        {
	            log WARNING &quot;Entity already added ($type): $entity&quot;
	            continue
	        }
	        else
	        {
	            try {
					$entityExtractor.Inclusions.Add($entity)
					log VERBOSE &quot;Added entity ($type): $entity&quot;
				} catch {
					log ERROR &quot;Failed to add entity ($type): $entity&quot;
				}
			}
		}
		elseif ($addto -eq &quot;exclude&quot;)
		{
			if ( $entityExtractor.Exclusions.Contains($entity) )
	        {
	            log WARNING &quot;Entity already excluded ($type): $entity&quot;
	            continue
	        }
	        else
	        {
	            try {
					$entityExtractor.Exclusions.Add($entity)
					log VERBOSE &quot;Excluded entity ($type): $entity&quot;
				}catch {
					log ERROR &quot;Failed to exclude entity ($type): $entity&quot;
				}
	        }
		}
    }
    log VERBOSE &quot;Finished loading $type properties.&quot;
}</pre><p>An example company list file could look like:</p><pre class="crayon-plain-tag">Apple
Comperio
Microsoft</pre><p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/03/Companies1.png"><img src="http://blog.comperiosearch.com/wp-content/uploads/2011/03/Companies1.png" alt="" width="492" height="207" /></a></p>
<p>If you did a crawl before starting on your white and black lists, you can use any noise in your navigators as input to the black list, and also entities missing in the white lists. An easy way to get all navigator values is to search for “#”, which will do a blank search showing all data you have access to.</p>
<p>Now that you have added the new white and/or black lists, you should schedule a new crawl and the quality of the entity refiners should be improved. Voila!</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/03/SearchForComperio.png"><img class="alignnone size-full wp-image-311" src="http://blog.comperiosearch.com/wp-content/uploads/2011/03/SearchForComperio.png" alt="" width="666" height="390" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/03/02/property-extraction-fs4sp/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
