mirror of
https://github.com/microsoft/graphrag.git
synced 2026-01-30 15:51:51 +08:00
Deploying to gh-pages from @ microsoft/graphrag@aff2f79ae2 🚀
This commit is contained in:
parent
550b426a36
commit
2e6b918e40
Binary file not shown.
@ -289,7 +289,7 @@ a {
|
||||
<!-- Main Content -->
|
||||
<main>
|
||||
<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, though it 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>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>Prerequisites</h2>
|
||||
<p>Before running the automatic template generation make sure you have already initialized your workspace with the <code>graphrag.index --init</code> command. This will create the necessary configuration files and the default prompts. Refer to the <a href="/graphrag/posts/config/init">Init Documentation</a> for more information about the initialization process.</p>
|
||||
@ -297,7 +297,7 @@ a {
|
||||
<p>You can run the main script from the command line with various options:</p>
|
||||
|
||||
<div style="position: relative">
|
||||
<pre class="language-bash"><code id="code-18" class="language-bash">python <span class="token parameter variable">-m</span> graphrag.prompt_tune <span class="token punctuation">[</span>--root ROOT<span class="token punctuation">]</span> <span class="token punctuation">[</span>--domain DOMAIN<span class="token punctuation">]</span> <span class="token punctuation">[</span>--method METHOD<span class="token punctuation">]</span> <span class="token punctuation">[</span>--limit LIMIT<span class="token punctuation">]</span> <span class="token punctuation">[</span>--max-tokens MAX_TOKENS<span class="token punctuation">]</span> <span class="token punctuation">[</span>--chunk-size CHUNK_SIZE<span class="token punctuation">]</span> <span class="token punctuation">[</span>--no-entity-types<span class="token punctuation">]</span> <span class="token punctuation">[</span>--output OUTPUT<span class="token punctuation">]</span></code></pre>
|
||||
<pre class="language-bash"><code id="code-18" class="language-bash">python <span class="token parameter variable">-m</span> graphrag.prompt_tune <span class="token punctuation">[</span>--root ROOT<span class="token punctuation">]</span> <span class="token punctuation">[</span>--domain DOMAIN<span class="token punctuation">]</span> <span class="token punctuation">[</span>--method METHOD<span class="token punctuation">]</span> <span class="token punctuation">[</span>--limit LIMIT<span class="token punctuation">]</span> <span class="token punctuation">[</span>--language <span class="token environment constant">LANGUAGE</span><span class="token punctuation">]</span> <span class="token punctuation">[</span>--max-tokens MAX_TOKENS<span class="token punctuation">]</span> <span class="token punctuation">[</span>--chunk-size CHUNK_SIZE<span class="token punctuation">]</span> <span class="token punctuation">[</span>--no-entity-types<span class="token punctuation">]</span> <span class="token punctuation">[</span>--output OUTPUT<span class="token punctuation">]</span></code></pre>
|
||||
|
||||
<button class="code-copy " data-clipboard-target="#code-18" 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>
|
||||
@ -318,6 +318,9 @@ a {
|
||||
<p><code>--limit</code> (optional): The limit of text units to load when using random or top selection. Default is 15.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>--language</code> (optional): The language to use for input processing. If it is different from the inputs' language, the LLM will translate. Default is "" meaning it will be automatically detected from the inputs.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>--max-tokens</code> (optional): Maximum token count for prompt generation. Default is 2000.</p>
|
||||
</li>
|
||||
<li>
|
||||
@ -333,18 +336,18 @@ a {
|
||||
<h2>Example Usage</h2>
|
||||
|
||||
<div style="position: relative">
|
||||
<pre class="language-bash"><code id="code-67" 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>
|
||||
<pre class="language-bash"><code id="code-72" 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">--language</span> English --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-67" 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-72" 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>
|
||||
</button>
|
||||
</div>
|
||||
<p>or, with minimal configuration (suggested):</p>
|
||||
|
||||
<div style="position: relative">
|
||||
<pre class="language-bash"><code id="code-71" 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-76" 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>
|
||||
|
||||
<button class="code-copy " data-clipboard-target="#code-71" 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-76" 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>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user