Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

of

Nif practical Slide 1 Nif practical Slide 2 Nif practical Slide 3 Nif practical Slide 4 Nif practical Slide 5 Nif practical Slide 6 Nif practical Slide 7 Nif practical Slide 8 Nif practical Slide 9 Nif practical Slide 10 Nif practical Slide 11 Nif practical Slide 12 Nif practical Slide 13 Nif practical Slide 14 Nif practical Slide 15 Nif practical Slide 16 Nif practical Slide 17 Nif practical Slide 18 Nif practical Slide 19 Nif practical Slide 20 Nif practical Slide 21 Nif practical Slide 22 Nif practical Slide 23 Nif practical Slide 24 Nif practical Slide 25 Nif practical Slide 26 Nif practical Slide 27 Nif practical Slide 28 Nif practical Slide 29 Nif practical Slide 30 Nif practical Slide 31 Nif practical Slide 32 Nif practical Slide 33
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

0 Likes

Share

Download to read offline

Nif practical

Download to read offline

LIDER Datathon NIF Practical Session

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Nif practical

  1. 1. 1 The NIF format (hands on) Annotating Strings and Documents using the NLP Interchange Format
  2. 2. 2 Practical session outcomes • Participants will learn to use NIF API to annotate strings and documents using the following wrappers: –OpenNLP –Stanford Core NLP –Snowball Stemmer –DBpedia Spotlight • Query your corpus using SPARQL
  3. 3. 3 NIF Example
  4. 4. 4 Snowball Stemmer Wrapper • Stemming algorithm is a process for removing suffixes from words. –CONNECT • CONNECTED • CONNECTION • CONNECTING • CONNECTIONS
  5. 5. 5 Snowball Stemmer Wrapper java -jar snowball.jar -f text -i 'I am connected.' • -f is used to define the format • -i is used to define the input
  6. 6. 6 Snowball Stemmer Wrapper
  7. 7. 7 Snowball Stemmer Wrapper
  8. 8. 8 Snowball Stemmer Wrapper NIF Standard Annotations NIF Offset
  9. 9. 9 Snowball Stemmer Wrapper NIF Standard Annotations Snowball Stemmer NIF Offset
  10. 10. 10 Annotating Strings: Step-by-step • 1. Open the USB stick folder • 2. Decompress the “session-nif.zip” folder • 3. Open the “NIF_DATATHON” folder and decompress “NIF_tutorial_hands_on_jars.zip” • Open the prompt command, and use the commands from the next slide in the “jar” folder.
  11. 11. 11 Available Wrappers • To annotate documents, use the local wrappers (USB Stick) java -jar opennlp.jar -f text -i 'This is a test.' -modelFolder ../model/ java -jar stanford.jar -f text -i 'This is a test.' java -jar snowball.jar -f text -i 'This is my favorite test.' java -jar spotlight.jar -f text -i 'Welcome to Germany.' -confidence 0.2 • To annotate small strings, you can try the on-line services: http://spotlight.nlp2rdf.aksw.org/spotlight? f=text&i=Welcome+to+Germany.&t=direct&confidence=0.3&prefix=http://yourDomain.org/ • http://snowball.nlp2rdf.aksw.org/snowball? f=text&i=This+is+my+favorite+test.&t=direct&prefix=http://yourDomain.org/ • http://stanford.nlp2rdf.aksw.org/stanfordcorenlpn? f=text&i=This+is+a+test.&t=direct&prefix=http://yourDomain.org/ • http://opennlp.nlp2rdf.aksw.org/opennlp? f=text&i=This+is+a+test.&t=direct&modelFolder=model&prefix=http://yourDomain.org
  12. 12. 12 Reading and Writing Files • Write results in a file: “--outfile myAnnotatedFile.ttl“ • Read a document as input “--intype file -i /path/myDoc”
  13. 13. 13 POS tagger for multiple languages • The -modelFolder parameter set the folder that contains the POS tagging OpenNLP trained models and tokenization. • Different languages can be found at OpenNLP website http://opennlp.sourceforge.net/models- 1.5/http://opennlp.sourceforge.net/models-1.5/
  14. 14. 14 Example 2: Query a Corpus
  15. 15. 15 Querying with Twinkle Open the “/twinkle” folder and run the command: java -jar twinkle.jar
  16. 16. 16 Querying a Corpus
  17. 17. 17 Querying a Corpus
  18. 18. 18 Querying a Corpus
  19. 19. 19 Querying a Corpus
  20. 20. 20 Querying a Corpus
  21. 21. 21 Querying a Corpus
  22. 22. 22 Querying a Corpus
  23. 23. 23 Querying a Corpus
  24. 24. 24 Querying a Corpus
  25. 25. 25 Querying a Corpus
  26. 26. 26 Querying a Corpus
  27. 27. 27 Querying a Corpus
  28. 28. 28 Querying a Corpus
  29. 29. 29 Exercise 3: Querying your own NIF annotated corpus
  30. 30. 30 Querying your own NIF annotated corpus 1. Annotate your string using one of the wrappers 2. Save your annotated sentence to a file (using “--outfile”) 3. Open Twinkle 4. Query your corpus using Twinkle
  31. 31. 31 • Query your annotated corpus: – nif:Context – nif:Sentence – nif:anchorOf – nif:oliaCategory – nif:oliaLink … or practice with Brown Corpus!
  32. 32. 32
  33. 33. 33 Thank you! http://site.nlp2rdf.org/

LIDER Datathon NIF Practical Session

Views

Total views

1,390

On Slideshare

0

From embeds

0

Number of embeds

15

Actions

Downloads

8

Shares

0

Comments

0

Likes

0

×