পৃষ্ঠাসমূহ

Search Your Article

CS

Pageviews

Showing posts with label TIKA Tutorial. Show all posts
Showing posts with label TIKA Tutorial. Show all posts

Wednesday, January 25, 2017

TIKA - Overview

What is Apache Tika?

  • Apache Tika is a library that is used for document type detection and content extraction from various file formats.
  • Internally, Tika uses various existing document parsers and document type detection techniques to detect and extract data.

TIKA - Architecture

Application-Level Architecture of Tika

Application programmers can easily integrate Tika in their applications. Tika provides a Command Line Interface and a GUI to make it user friendly.

TIKA - Environment

This chapter takes you through the process of setting up Apache Tika on Windows and Linux. User administration is needed while installing the Apache Tika.

TIKA - Referenced API

Users can embed Tika in their applications using the Tika facade class. It has methods to explore all the functionalities of Tika. Since it is a facade class, Tika abstracts the complexity behind its functions. In addition to this, users can also use the various classes of Tika in their applications.

TIKA - File Formats

File Formats Supported by Tika

The following table shows the file formats Tika supports.
File format Package Library Class in Tika

TIKA - Document Type Detection

MIME Standards

Multipurpose Internet Mail Extensions (MIME) standards are the best available standards for identifying document types. The knowledge of these standards helps the browser during internal interactions.

TIKA - Content Extraction

Tika uses various parser libraries to extract content from given parsers. It chooses the right parser for extracting the given document type.
For parsing documents, the parseToString() method of Tika facade class is generally used. Shown below are the steps involved in the parsing process and these are abstracted by the Tika ParsertoString() method.

TIKA - Metadata Extraction

Besides content, Tika also extracts the metadata from a file. Metadata is nothing but the additional information supplied with a file. If we consider an audio file, the artist name, album name, title comes under metadata.

TIKA - Language Detection

Need for Language Detection

For classification of documents based on the language they are written in a multilingual website, a language detection tool is needed. This tool should accept documents without language annotation (metadata) and add that information in the metadata of the document by detecting the language.

TIKA - GUI

Graphical User Interface (GUI)

TIKA - Extracting PDF

Given below is the program to extract content and metadata from a PDF.
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

TIKA - Extracting ODF

Given below is the program to extract content and metadata from Open Office Document Format (ODF).
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

TIKA - Extracting MS Office Files

Given below is the program to extract content and metadata from a Microsoft Office Document.
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

TIKA - Extracting Text Document

Given below is the program to extract content and metadata from a Text document:
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

TIKA - Extracting HTML Document

Given below is the program to extract content and metadata from an HTML document.
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

TIKA - Extracting XML Document

Given below is the program to extract content and metadata from an XML document:
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

TIKA - Extracting .class File

Given below is the program to extract content and metadata from a .class file.
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

TIKA - Extracting JAR File

Given below is the program to extract content and metadata from a Java Archive (jar) file:

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

TIKA - Extracting Image File

Given below is the program to extract content and meta data from a JPEG image.
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

TIKA - Extracting mp4 Files

Given below is the program to extract content and metadata from mp4 files:
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;