Artificial Intelligence

Artificial Intelligence for DOCX documents

Information

phpdocx 14 Premium licenses include a new AI module for integration of Artificial Intellegences when working with DOCX documents. It allows to extract information and to perform complex tasks in a simple way, with the help of AI integrations.

Currently, phpdocx supports two types of AI integrations:

  • phpdocx
  • GPT OpenAI

The available features for AI are the following:

  • Extract top keywords: phpdocx and GPT OpenAI.
  • Check spelling and fix misspelled words: phpdocx.
  • Summarize contents: phpdocx and GPT OpenAI.
  • Grammar correction: GPT OpenAI.
  • Generate a content from a description: GPT OpenAI.
  • Translate contents: GPT OpenAI.
  • Do a custom request to GPT OpenAI: GPT OpenAI.
phpdocx AI

This is a set of AI functionalities for phpdocx exclusively, that use the Premium package classes.

The available features are:

  • Extract top keywords.
  • Check spelling and fix misspelled words.
  • Summarize contents.

These methods work just like any other of phpdocx, by calling the AIPhpdocx class.

This is how to extract the top keywords of a document:

How to analyze misspelled words and correct them in a newly created document:

GPT OpenAI

This is an integration of the GPT OpenAI API. It performs AI tasks in DOCX documents with phpdocx.

The available features are the following:

  • Extract top keywords.
  • Summarize contents.
  • Grammar correction.
  • Generate a content from a description.
  • Translate contents.
  • Do a custom request to GPT OpenAI: GPT OpenAI.

Integration with GPT OpenAI is done with the AIGPT class. This allows to define different options to customize the communication with OpenAI.

This shows how to extract top keywords:

How to summarize the content of a document:

Translate a document to spanish:

In order to work with this GPT OpenAI integration, it is mandatory to generate and add an OpenAI API key.

For more information

There are examples for every method and option available in the package and the API documentation.

By default, most of the methods analyze all the paragraphs of the document. It is possible to change this behaviour, using DOCXPath queries. For example, by choosing paragraphs with contents or specific positions.