Ollamaサービスには、テキストを生成するためのREST APIエンドポイントがあります。JSONオブジェクトにURLおよびその他の構成パラメータを指定します。
var gent_ollama_params clob;
exec :gent_ollama_params := '{
"provider": "ollama",
"host" : "local",
"url" : "http://localhost:11434/api/generate",
"model" : "llama3"
}';
select dbms_vector.utl_to_generate_text('What is Oracle Text?', json(:gent_ollama_params)) from dual;
必要に応じて、url
およびmodel
を独自の値に置き換えることができます。
プロンプトに対する応答は次のように表示されます:
Oracle Text (formerly known as Oracle InterMedia) is a suite of text search and retrieval tools within Oracle Database. It allows you to index and query
unstructured text data, such as documents, emails, and other text-based content.
With Oracle Text, you can:
1. Index text: Create indexes on text columns or external files, making it possible to efficiently search and retrieve relevant text data.
2. Query text: Use SQL syntax to query the indexed text data, allowing you to find specific words, phrases, or patterns within large volumes of
text.
3. Full-text search: Perform full-text searches on unstructured text data, returning relevant results based on keyword matches, proximity, and
relevance.
Oracle Text supports various indexing schemes, including:
1. Basic Indexing: A simple, fast index for searching exact keywords.
2. Phrase Indexing: An index that allows you to search for phrases (e.g., "John Smith").
3. Thesaurus Indexing: An index that enables searches based on synonyms and related words.
Oracle Text also includes various text analysis and processing features, such as:
1. Tokenization: Breaking down text into individual words or tokens.
2. Stemming: Reducing words to their base form (e.g., "running" becomes "run").
3. Stopword removal: Eliminating common words like "the," "and," and "a" that don't add much value to the search.
Oracle Text is particularly useful in scenarios where you need to search, analyze, or retrieve unstructured text data, such as:
1. Content management: Searching and retrieving documents, articles, or other content.
2. Email archiving: Indexing and searching email messages.
3. Search engines: Building custom search solutions for specific domains or industries.
In summary, Oracle Text is a powerful tool within the Oracle Database that enables you to index, query, and retrieve unstructured text data with ease.