< Back

Get-EntityLink

Sun Jan 19, 2020 5:35 pm

NAME Get-EntityLink



SYNOPSIS

Recognize a named-entity from given text and aligning a textual mention of the entity to an appropriate entry in a

knowledge base.





SYNTAX

Get-EntityLink [-String] <String> [<CommonParameters>]





DESCRIPTION

Identifies and Maps named entities to appropriate knowledge base articles using Microsoft cognitive service's

"Entity linking" API.

NOTE : You need to subscribe the "Entity linking API" before using the powershell script from the following link

and setup an environment variable like, $env:MS_EntityLink_API_key = "YOUR API KEY"



API Subscription Page - https://www.microsoft.com/cognitive-ser ... us/sign-up





PARAMETERS

-String <String>

String to search for named entities.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Author: Prateek Singh - @SinghPrateik



-------------------------- EXAMPLE 1 --------------------------



PS Root\\>Get-EntityLink -String "NASA sends space shuttles to ISS"



Name Match MatchIndices Wiki Link

---- ----- ------------ ---------

NASA NASA (0,3) http://en.wikipedia.org/wiki/NASA

International Space Station ISS (29,31) http://en.wikipedia.org/wiki/Internatio ... ce_Station



In above example, I passed an string to cmdlet in order to link some word entities to wikipedia pages/articles









-------------------------- EXAMPLE 2 --------------------------



PS Root\\>"Bill gates invented Windows operating system " | Get-EntityLink



Name Match MatchIndices Wiki Link

---- ----- ------------ ---------

Bill Gates Bill gates (0,9) http://en.wikipedia.org/wiki/Bill_Gates

Microsoft Windows Windows operating system (20,43) http://en.wikipedia.org/wiki/Microsoft_Windows



You can also pass string from pipeline as the cmdlet accpets input from pipeline









-------------------------- EXAMPLE 3 --------------------------



PS Root\\>Get-Content File.txt | Out-String | Get-EntityLink



Name Match MatchIndices Wiki Link



---- ----- ------------ ---------



Windows PowerShell {PowerShell, PS} {(0,1), (37,38), (403,404), (1267,1268)...}

http://en.wikipedia.org/wiki/Windows_PowerShell

Microsoft Microsoft (101,109)

http://en.wikipedia.org/wiki/Microsoft

Flow Java ToString (3058,3065)

http://en.wikipedia.org/wiki/Java_(prog ... _language)

UTF-8 Unicode/UTF-8 (3288,3300) http://en.wikipedia.org/wiki/UTF-8





Convert content of a file to string and pipe to generate Entity links for the whole Document.











RELATED LINKS