Skip to content

Commit 3cca276

Browse files
committed
add linear_ngram model
1 parent 5d29431 commit 3cca276

File tree

11 files changed

+1205
-379
lines changed

11 files changed

+1205
-379
lines changed

docs/auggam/auggam.html

Lines changed: 233 additions & 205 deletions
Large diffs are not rendered by default.

docs/auggam/embed.html

Lines changed: 149 additions & 81 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<p align="center">
2828
<img src="https://microsoft.github.io/aug-models/embgam_gif.gif" width="18%">
2929
<img align="center" width=40% src="https://csinva.io/imodelsX/imodelsx_logo.svg?sanitize=True&kill_cache=1"> </img> <img src="https://microsoft.github.io/aug-models/embgam_gif.gif" width="18%"></p>
30-
<p align="center">Library to explain <i>a dataset</i> in natural language.
30+
<p align="center">Scikit-learn friendly library to interpret, predict, and prompt-engineer text datasets.
3131
</p>
3232
<p align="center">
3333
<a href="https://github.com/csinva/imodelsX/tree/master/demo_notebooks">📖 demo notebooks</a>
@@ -133,7 +133,7 @@ <h3 id="d3-describedistributionaldifferences">D3 (DescribeDistributionalDifferen
133133
batch_size=64,
134134
)
135135
</code></pre>
136-
<h3 id="aug-models">Aug-models</h3>
136+
<h3 id="aug-imodels">Aug-imodels</h3>
137137
<p>Use these just a like a scikit-learn model. During training, they fit better features via LLMs, but at test-time they are extremely fast and completely transparent.</p>
138138
<pre><code class="language-python">from imodelsx import AugGAMClassifier, AugTreeClassifier, AugGAMRegressor, AugTreeRegressor
139139
import datasets
@@ -165,10 +165,10 @@ <h3 id="aug-models">Aug-models</h3>
165165
for k, v in sorted(m.coefs_dict_.items(), key=lambda item: item[1])[:8]:
166166
print('\t', k, round(v, 2))
167167
</code></pre>
168-
<h3 id="linear-finetune">Linear finetune</h3>
169-
<p>An easy-to-fit baseline that follows the same API.</p>
170-
<pre><code class="language-python">from imodelsx import LinearFinetuneClassifier
171-
# fit a simple one-layer finetune
168+
<h3 id="easy-baselines">Easy baselines</h3>
169+
<p>Easy-to-fit baselines that follows the same API.</p>
170+
<pre><code class="language-python">from imodelsx import LinearFinetuneClassifier, LinearNgramClassifier
171+
# fit a simple one-layer finetune on top of LLM embeddings
172172
m = LinearFinetuneClassifier(
173173
checkpoint='distilbert-base-uncased',
174174
)
@@ -252,6 +252,10 @@ <h2 class="section-title" id="header-submodules">Sub-modules</h2>
252252
<dd>
253253
<div class="desc"><p>Simple scikit-learn interface for finetuning a single linear layer on top of LLM embeddings.</p></div>
254254
</dd>
255+
<dt><code class="name"><a title="imodelsx.linear_ngram" href="linear_ngram.html">imodelsx.linear_ngram</a></code></dt>
256+
<dd>
257+
<div class="desc"><p>Simple scikit-learn interface for finetuning a single linear layer on top of LLM embeddings.</p></div>
258+
</dd>
255259
<dt><code class="name"><a title="imodelsx.llm" href="llm.html">imodelsx.llm</a></code></dt>
256260
<dd>
257261
<div class="desc"></div>
@@ -296,8 +300,8 @@ <h1>Index</h1>
296300
<li><a href="#quickstart">Quickstart</a><ul>
297301
<li><a href="#iprompt">iPrompt</a></li>
298302
<li><a href="#d3-describedistributionaldifferences">D3 (DescribeDistributionalDifferences)</a></li>
299-
<li><a href="#aug-models">Aug-models</a></li>
300-
<li><a href="#linear-finetune">Linear finetune</a></li>
303+
<li><a href="#aug-imodels">Aug-imodels</a></li>
304+
<li><a href="#easy-baselines">Easy baselines</a></li>
301305
<li><a href="#sasc">SASC</a></li>
302306
</ul>
303307
</li>
@@ -315,6 +319,7 @@ <h1>Index</h1>
315319
<li><code><a title="imodelsx.dummy_script" href="dummy_script.html">imodelsx.dummy_script</a></code></li>
316320
<li><code><a title="imodelsx.iprompt" href="iprompt/index.html">imodelsx.iprompt</a></code></li>
317321
<li><code><a title="imodelsx.linear_finetune" href="linear_finetune.html">imodelsx.linear_finetune</a></code></li>
322+
<li><code><a title="imodelsx.linear_ngram" href="linear_ngram.html">imodelsx.linear_ngram</a></code></li>
318323
<li><code><a title="imodelsx.llm" href="llm.html">imodelsx.llm</a></code></li>
319324
<li><code><a title="imodelsx.metrics" href="metrics.html">imodelsx.metrics</a></code></li>
320325
<li><code><a title="imodelsx.process_results" href="process_results.html">imodelsx.process_results</a></code></li>

0 commit comments

Comments
 (0)