mirror of
https://github.com/microsoft/graphrag.git
synced 2025-09-17 20:24:20 +00:00
Deploying to gh-pages from @ microsoft/graphrag@4bca3083f6 🚀
This commit is contained in:
parent
b1c6c6cc04
commit
b9af10e5d6
Binary file not shown.
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/" class="is-active" aria-current="page">Configuration</a>
|
<a href="/posts/config/overview/" class="is-active" aria-current="page">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/" class="is-active" aria-current="page">CLI</a>
|
<a href="/posts/index/2-cli/" class="is-active" aria-current="page">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -1,350 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Prompt Tuning</title>
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
|
|
||||||
<link href="https://unpkg.com/prismjs@1.20.0/themes/prism-okaidia.css" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Primer/19.1.1/tooltips.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
|
|
||||||
<style>
|
|
||||||
html {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
body{
|
|
||||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer{
|
|
||||||
width: 100%;
|
|
||||||
height: 32px;
|
|
||||||
font-size: 12px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 18px;
|
|
||||||
align-items: center;
|
|
||||||
color: #5d5d5d;
|
|
||||||
background: #e9eaeb;
|
|
||||||
border-top: 1px solid #c4c5c6;
|
|
||||||
}
|
|
||||||
|
|
||||||
#cookiesManager{
|
|
||||||
cursor: pointer;
|
|
||||||
color: #485fc7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
overflow: scroll;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
header {
|
|
||||||
background-color: lightgrey;
|
|
||||||
height: 2%;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav {
|
|
||||||
padding: 1em;
|
|
||||||
min-width: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
main {
|
|
||||||
flex: 1;
|
|
||||||
padding: 0 5em 0 5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logotitle {
|
|
||||||
font-size: 1.5em;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.number {
|
|
||||||
all: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag.token {
|
|
||||||
all: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
main ul {
|
|
||||||
list-style-type: disc;
|
|
||||||
padding-left: 30px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 2rem;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 1.5rem;
|
|
||||||
margin-top: 10px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 1rem;
|
|
||||||
margin-top: 10px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Accessibility styling */
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #485fc7;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-list a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.token.comment, .token.prolog, .token.doctype, .token.cdata {
|
|
||||||
color: #8093a5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted {
|
|
||||||
color: #ff36ab;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="module" async="">import mermaid from "https://unpkg.com/mermaid@10/dist/mermaid.esm.min.mjs";document.addEventListener('DOMContentLoaded', mermaid.initialize({"loadOnSave":true}));</script>
|
|
||||||
<script>function showTooltip(o,e){o.trigger.className.includes("tooltipped")||(o.trigger.children[0].className="tooltipped tooltipped-s",o.trigger.children[0].ariaLabel=e)}window.addEventListener("load",()=>{var o=new ClipboardJS(".code-copy");o.on("success",o=>showTooltip(o,"Copied!")),o.on("error",o=>showTooltip(o,"Failed..."))});</script>
|
|
||||||
<script async="" src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<script src="https://wcpstatic.microsoft.com/mscc/lib/v2/wcp-consent.js" type="text/javascript"></script>
|
|
||||||
<script>
|
|
||||||
function onConsentChanged(categoryPreferences) {
|
|
||||||
console.log("onConsentChanged", categoryPreferences);
|
|
||||||
}
|
|
||||||
|
|
||||||
var siteConsent
|
|
||||||
|
|
||||||
function initialize(){
|
|
||||||
var currentYear = new Date().getFullYear()
|
|
||||||
document.getElementById("copyright").innerHTML = `©️ ${currentYear} Microsoft`;
|
|
||||||
window.WcpConsent && WcpConsent.init("en-US", "cookie-banner", function (err, _siteConsent) {
|
|
||||||
if (!err) {
|
|
||||||
siteConsent = _siteConsent; //siteConsent is used to get the current consent
|
|
||||||
} else {
|
|
||||||
console.log("Error initializing WcpConsent: "+ err);
|
|
||||||
}
|
|
||||||
}, onConsentChanged, WcpConsent.themes.light);
|
|
||||||
}
|
|
||||||
|
|
||||||
addEventListener("DOMContentLoaded", initialize)
|
|
||||||
addEventListener("DOMContentLoaded", checkCookieManager)
|
|
||||||
|
|
||||||
function checkCookieManager(){
|
|
||||||
if(siteConsent.isConsentRequired){
|
|
||||||
document.getElementById("cookiesManager").style.display = 'block';
|
|
||||||
document.getElementById("divider").style.display = 'block';
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
document.getElementById("cookiesManager").style.display = 'none';
|
|
||||||
document.getElementById("divider").style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function manageConsent() {
|
|
||||||
if(siteConsent.isConsentRequired){
|
|
||||||
siteConsent.manageConsent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<div id="cookie-banner"></div>
|
|
||||||
<a href="/"><span class="logotitle">GraphRAG</span></a>
|
|
||||||
</header>
|
|
||||||
<div class="page-content">
|
|
||||||
<!-- Sidebar -->
|
|
||||||
<aside class="menu">
|
|
||||||
<ul class="menu-list">
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="/">Welcome</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<!-- Get Started Links -->
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="/posts/get_started/">Get Started</a>
|
|
||||||
|
|
||||||
|
|
||||||
<a href="/posts/developing/">Developing</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<!-- Indexing Links -->
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="/posts/index/overview/">Indexing</a>
|
|
||||||
|
|
||||||
<ul><li>
|
|
||||||
<a href="/posts/index/0-architecture/">Architecture</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="/posts/index/1-default_dataflow/">Dataflow</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="/posts/index/3-prompt_tuning/" class="is-active" aria-current="page">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a href="/posts/config/env_vars">Using Env Vars</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="/posts/config/json_yaml">Using JSON or YAML</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="/posts/config/custom">Fully Custom</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="/posts/config/template">Template</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="/posts/prompt_tuning/overview/">Prompt Tuning</a>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="/posts/prompt_tuning/auto_prompt_tuning/">Automatic Templating</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="/posts/prompt_tuning/manual_prompt_tuning/">Manual Prompt Tuning</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Query Links -->
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="/posts/query/overview/">Query</a>
|
|
||||||
|
|
||||||
<ul><li>
|
|
||||||
<a href="/posts/query/1-local_search/">Local Search</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="/posts/query/2-question_generation/">Question Generation</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="/posts/query/0-global_search/">Global Search</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="/posts/query/3-cli/">CLI</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/query/notebooks/overview/">Notebooks</a>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a href="/posts/query/notebooks/global_search_nb">Global Search</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="/posts/query/notebooks/local_search_nb">Local Search</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
<!-- Main Content -->
|
|
||||||
<main>
|
|
||||||
<h1>Prompt Tuning</h1>
|
|
||||||
<p>The GraphRAG indexer, by default, will run with a handful of prompts that are designed to work well in the broad context of knowledge discovery.
|
|
||||||
However, it is quite common to want to tune the prompts to better suit your specific use case.
|
|
||||||
We provide a means for you to do this by allowing you to specify a custom prompt file, which will each use a series of token-replacements internally.</p>
|
|
||||||
<p>Each of these prompts may be overridden by writing a custom prompt file in plaintext. We use token-replacements in the form of <code>{token_name}</code>, and the descriptions for the available tokens can be found below.</p>
|
|
||||||
<h2>Entity/Relationship Extraction</h2>
|
|
||||||
<p><a href="http://github.com/microsoft/graphrag/blob/main/graphrag/index/graph/extractors/graph/prompts.py">Prompt Source</a></p>
|
|
||||||
<h3>Tokens (values provided by extractor)</h3>
|
|
||||||
<ul>
|
|
||||||
<li><strong>{input_text}</strong> - The input text to be processed.</li>
|
|
||||||
<li><strong>{entity_types}</strong> - A list of entity types</li>
|
|
||||||
<li><strong>{tuple_delimiter}</strong> - A delimiter for separating values within a tuple. A single tuple is used to represent an individual entity or relationship.</li>
|
|
||||||
<li><strong>{record_delimiter}</strong> - A delimiter for separating tuple instances.</li>
|
|
||||||
<li><strong>{completion_delimiter}</strong> - An indicator for when generation is complete.</li>
|
|
||||||
</ul>
|
|
||||||
<h2>Summarize Entity/Relationship Descriptions</h2>
|
|
||||||
<p><a href="http://github.com/microsoft/graphrag/blob/main/graphrag/index/graph/extractors/summarize/prompts.py">Prompt Source</a></p>
|
|
||||||
<h3>Tokens (values provided by extractor)</h3>
|
|
||||||
<ul>
|
|
||||||
<li><strong>{entity_name}</strong> - The name of the entity or the source/target pair of the relationship.</li>
|
|
||||||
<li><strong>{description_list}</strong> - A list of descriptions for the entity or relationship.</li>
|
|
||||||
</ul>
|
|
||||||
<h2>Claim Extraction</h2>
|
|
||||||
<p><a href="http://github.com/microsoft/graphrag/blob/main/graphrag/index/graph/extractors/claims/prompts.py">Prompt Source</a></p>
|
|
||||||
<h3>Tokens (values provided by extractor)</h3>
|
|
||||||
<ul>
|
|
||||||
<li><strong>{input_text}</strong> - The input text to be processed.</li>
|
|
||||||
<li><strong>{tuple_delimiter}</strong> - A delimiter for separating values within a tuple. A single tuple is used to represent an individual entity or relationship.</li>
|
|
||||||
<li><strong>{record_delimiter}</strong> - A delimiter for separating tuple instances.</li>
|
|
||||||
<li><strong>{completion_delimiter}</strong> - An indicator for when generation is complete.</li>
|
|
||||||
</ul>
|
|
||||||
<p>Note: there is additional paramater for the <code>Claim Description</code> that is used in claim extraction.
|
|
||||||
The default value is</p>
|
|
||||||
<p><code>"Any claims or facts that could be relevant to information discovery."</code></p>
|
|
||||||
<p>See the <a href="/posts/config/overview/">configuration documentation</a> for details on how to change this.</p>
|
|
||||||
<h2>Generate Community Reports</h2>
|
|
||||||
<p><a href="http://github.com/microsoft/graphrag/blob/main/graphrag/index/graph/extractors/community_reports/prompts.py">Prompt Source</a></p>
|
|
||||||
<h3>Tokens (values provided by extractor)</h3>
|
|
||||||
<ul>
|
|
||||||
<li><strong>{input_text}</strong> - The input text to generate the report with. This will contain tables of entities and relationships.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<a href="https://go.microsoft.com/fwlink/?LinkId=521839">Privacy</a>
|
|
||||||
|
|
|
||||||
<a href="https://go.microsoft.com/fwlink/?LinkId=2259814">Consumer Health Privacy</a>
|
|
||||||
|
|
|
||||||
<span id="cookiesManager" onClick="manageConsent();">Cookies</span>
|
|
||||||
<span id="divider">|</span>
|
|
||||||
<a href="https://go.microsoft.com/fwlink/?LinkID=206977">Terms of Use</a>
|
|
||||||
|
|
|
||||||
<a href="https://www.microsoft.com/trademarks">Trademarks</a>
|
|
||||||
|
|
|
||||||
<a href="https://www.microsoft.com" id="copyright"></a>
|
|
||||||
|
|
|
||||||
<a href="https://github.com/microsoft/graphrag">GitHub</a>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
@ -288,8 +286,8 @@ a {
|
|||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<main>
|
<main>
|
||||||
<h1>Prompt Tuning ⚙️</h1>
|
<h1>Prompt Tuning ⚙️</h1>
|
||||||
<p>GraphRAG provides the ability to create domain adaptive templates for the generation of the knowledge graph. This step is optional, tho is is highly encouraged to run it as it will yield better results when executing an Index Run.</p>
|
<p>GraphRAG provides the ability to create domain adaptive templates for the generation of the knowledge graph. This step is optional, though is is highly encouraged to run it as it will yield better results when executing an Index Run.</p>
|
||||||
<p>This templates are generated by loading the inputs, splitting them into chunks and then running a series of LLM invocations and template subtitions to generate the final prompts. It is highly suggested to use the default values the script provides, but in this page you'll find the detail of each in case you want to further explore and tweak the template generation algorithm.</p>
|
<p>The templates are generated by loading the inputs, splitting them into chunks (text units) and then running a series of LLM invocations and template substitutions to generate the final prompts. We suggest using the default values provided by the script, but in this page you'll find the detail of each in case you want to further explore and tweak the template generation algorithm.</p>
|
||||||
<h2>Usage</h2>
|
<h2>Usage</h2>
|
||||||
<p>You can run the main script from the command line with various options:</p>
|
<p>You can run the main script from the command line with various options:</p>
|
||||||
|
|
||||||
@ -303,40 +301,40 @@ a {
|
|||||||
<h2>Command-Line Options</h2>
|
<h2>Command-Line Options</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<p>--root (optional): The data project root directory, including the config files (YML, JSON, or .env). Defaults to the current directory.</p>
|
<p><code>--root</code> (optional): The data project root directory, including the config files (YML, JSON, or .env). Defaults to the current directory.</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>--domain (optional): The domain related to your input data, such as 'space science', 'microbiology', or 'environmental news'. If left empty, the domain will be inferred from the input data.</p>
|
<p><code>--domain</code> (optional): The domain related to your input data, such as 'space science', 'microbiology', or 'environmental news'. If left empty, the domain will be inferred from the input data.</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>--method (required): The method to select documents. Options are all, random, or top. Default is random.</p>
|
<p><code>--method</code> (optional): The method to select documents. Options are all, random, or top. Default is random.</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>--limit (optional): The limit of files to load when using random or top selection. Default is 15.</p>
|
<p><code>--limit</code> (optional): The limit of text units to load when using random or top selection. Default is 15.</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>--max-tokens (optional): Maximum token count for prompt generation. Default is set by MAX_TOKEN_COUNT which is 2000.</p>
|
<p><code>--max-tokens</code> (optional): Maximum token count for prompt generation. Default is 2000.</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>--chunk-size (optional): Minimum chunk size for prompt generation. Default is set by MIN_CHUNK_SIZE which is 200.</p>
|
<p><code>--chunk-size</code> (optional): The size in tokens to use for generating text units from input documents. Default is 200.</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>--no-entity-types (optional): Use untyped entity extraction generation. When your data is cover a lot of topics or it is highly randomized the guidance is to use untyped entity extraction..</p>
|
<p><code>--no-entity-types</code> (optional): Use untyped entity extraction generation. We recommend using this when your data covers a lot of topics or it is highly randomized.</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>--output (optional): The folder to save the generated prompts. Default is "prompts".</p>
|
<p><code>--output</code> (optional): The folder to save the generated prompts. Default is "prompts".</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>Example Usage</h2>
|
<h2>Example Usage</h2>
|
||||||
|
|
||||||
<div style="position: relative">
|
<div style="position: relative">
|
||||||
<pre class="language-bash"><code id="code-61" class="language-bash">python <span class="token parameter variable">-m</span> graphrag.prompt_tune <span class="token parameter variable">--root</span> /path/to/project <span class="token parameter variable">--domain</span> <span class="token string">"environmental news"</span> <span class="token parameter variable">--method</span> random <span class="token parameter variable">--limit</span> <span class="token number">10</span> <span class="token parameter variable">--max_tokens</span> <span class="token number">2048</span> <span class="token parameter variable">--chunk_size</span> <span class="token number">256</span> --no-entity-types <span class="token parameter variable">--output</span> /path/to/output</code></pre>
|
<pre class="language-bash"><code id="code-61" class="language-bash">python <span class="token parameter variable">-m</span> graphrag.prompt_tune <span class="token parameter variable">--root</span> /path/to/project <span class="token parameter variable">--domain</span> <span class="token string">"environmental news"</span> <span class="token parameter variable">--method</span> random <span class="token parameter variable">--limit</span> <span class="token number">10</span> --max-tokens <span class="token number">2048</span> --chunk-size <span class="token number">256</span> --no-entity-types <span class="token parameter variable">--output</span> /path/to/output</code></pre>
|
||||||
|
|
||||||
<button class="code-copy " data-clipboard-target="#code-61" style="position: absolute; top: 7.5px; right: 6px; padding-top: 3px; cursor: pointer; outline: none; opacity: 0.8;" title="Copy">
|
<button class="code-copy " data-clipboard-target="#code-61" style="position: absolute; top: 7.5px; right: 6px; padding-top: 3px; cursor: pointer; outline: none; opacity: 0.8;" title="Copy">
|
||||||
<span style="display:inline-block;background:url(https://api.iconify.design/mdi/content-copy.svg) no-repeat center center / contain;width: 16px; height: 16px;" class=""></span>
|
<span style="display:inline-block;background:url(https://api.iconify.design/mdi/content-copy.svg) no-repeat center center / contain;width: 16px; height: 16px;" class=""></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p>or</p>
|
<p>or, with minimal configuration (suggested):</p>
|
||||||
|
|
||||||
<div style="position: relative">
|
<div style="position: relative">
|
||||||
<pre class="language-bash"><code id="code-65" class="language-bash">python <span class="token parameter variable">-m</span> graphrag.prompt_tune <span class="token parameter variable">--root</span> /path/to/project --no-entity-types</code></pre>
|
<pre class="language-bash"><code id="code-65" class="language-bash">python <span class="token parameter variable">-m</span> graphrag.prompt_tune <span class="token parameter variable">--root</span> /path/to/project --no-entity-types</code></pre>
|
||||||
@ -345,11 +343,27 @@ a {
|
|||||||
<span style="display:inline-block;background:url(https://api.iconify.design/mdi/content-copy.svg) no-repeat center center / contain;width: 16px; height: 16px;" class=""></span>
|
<span style="display:inline-block;background:url(https://api.iconify.design/mdi/content-copy.svg) no-repeat center center / contain;width: 16px; height: 16px;" class=""></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<h2>Document Selection Methods</h2>
|
||||||
|
<p>The auto template feature ingests the input data and then divides it into text units the size of the chunk size parameter.
|
||||||
|
After that, it uses one of the following selection methods to pick a sample to work with for template generation:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>random</code>: Select text units randomly. This is the default and recommended option.</li>
|
||||||
|
<li><code>top</code>: Select the head n text units.</li>
|
||||||
|
<li><code>all</code>: Use all text units for the generation. Use only with small datasets; this option is not usually recommended.</li>
|
||||||
|
</ul>
|
||||||
<h2>Modify Env Vars</h2>
|
<h2>Modify Env Vars</h2>
|
||||||
<p>After running auto-templating, you should modify the following environment variables (or config variables) to pick up the new prompts on your index run.</p>
|
<p>After running auto-templating, you should modify the following environment variables (or config variables) to pick up the new prompts on your index run. Note: Please make sure to update the correct path to the generated prompts, in this example we are using the default "prompts" path.</p>
|
||||||
<p><code>GRAPHRAG_ENTITY_EXTRACTION_PROMPT_FILE</code> = "prompts/entity_extraction.txt"
|
<ul>
|
||||||
<code>GRAPHRAG_COMMUNITY_REPORT_PROMPT_FILE</code> = "prompts/community_report.txt"
|
<li>
|
||||||
<code>GRAPHRAG_SUMMARIZE_DESCRIPTIONS_PROMPT_FILE</code> = "prompts/summarize_descriptions.txt"</p>
|
<p><code>GRAPHRAG_ENTITY_EXTRACTION_PROMPT_FILE</code> = "prompts/entity_extraction.txt"</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p><code>GRAPHRAG_COMMUNITY_REPORT_PROMPT_FILE</code> = "prompts/community_report.txt"</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p><code>GRAPHRAG_SUMMARIZE_DESCRIPTIONS_PROMPT_FILE</code> = "prompts/summarize_descriptions.txt"</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Prompt Tuning 🤖</title>
|
<title>Prompt Tuning ⚙️</title>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
|
||||||
<link href="https://unpkg.com/prismjs@1.20.0/themes/prism-okaidia.css" rel="stylesheet">
|
<link href="https://unpkg.com/prismjs@1.20.0/themes/prism-okaidia.css" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Primer/19.1.1/tooltips.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Primer/19.1.1/tooltips.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
|
||||||
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
@ -287,7 +285,7 @@ a {
|
|||||||
|
|
||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<main>
|
<main>
|
||||||
<h1>Prompt Tuning 🤖</h1>
|
<h1>Prompt Tuning ⚙️</h1>
|
||||||
<p>This page provides an overview of the prompt tuning options available for the GraphRAG indexing engine.</p>
|
<p>This page provides an overview of the prompt tuning options available for the GraphRAG indexing engine.</p>
|
||||||
<h2>Default Prompts</h2>
|
<h2>Default Prompts</h2>
|
||||||
<p>The default prompts are the simplest way to get started with the GraphRAG system. It is designed to work out-of-the-box with minimal configuration. You can find more detail about these prompts in the following links:</p>
|
<p>The default prompts are the simplest way to get started with the GraphRAG system. It is designed to work out-of-the-box with minimal configuration. You can find more detail about these prompts in the following links:</p>
|
||||||
@ -300,7 +298,7 @@ a {
|
|||||||
<h2>Auto Templating</h2>
|
<h2>Auto Templating</h2>
|
||||||
<p>Auto Templating leverages your input data and LLM interactions to create domain adaptive templates for the generation of the knowledge graph. It is highly encouraged to run it as it will yield better results when executing an Index Run. For more details about how to use it, please refer to the <a href="/posts/prompt_tuning/auto_prompt_tuning">Auto Templating</a> documentation.</p>
|
<p>Auto Templating leverages your input data and LLM interactions to create domain adaptive templates for the generation of the knowledge graph. It is highly encouraged to run it as it will yield better results when executing an Index Run. For more details about how to use it, please refer to the <a href="/posts/prompt_tuning/auto_prompt_tuning">Auto Templating</a> documentation.</p>
|
||||||
<h2>Manual Configuration</h2>
|
<h2>Manual Configuration</h2>
|
||||||
<p>Manual configuration is an advanced use-case. Most users will want to use the Auto Templating feature instead.. Details about how to use manual configuration are available in the <a href="/posts/prompt_tunins/manual_prompt_tuning">Manual Prompt Configuration</a> documentation.</p>
|
<p>Manual configuration is an advanced use-case. Most users will want to use the Auto Templating feature instead. Details about how to use manual configuration are available in the <a href="/posts/prompt_tunins/manual_prompt_tuning">Manual Prompt Configuration</a> documentation.</p>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ a {
|
|||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/2-cli/">CLI</a>
|
<a href="/posts/index/2-cli/">CLI</a>
|
||||||
</li><li>
|
</li><li>
|
||||||
<a href="/posts/index/3-prompt_tuning/">Prompt Tuning</a>
|
|
||||||
</li><li>
|
|
||||||
|
|
||||||
<a href="/posts/config/overview/">Configuration</a>
|
<a href="/posts/config/overview/">Configuration</a>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user