Skip to content

Commit

Permalink
Deployed 5c019ec with MkDocs version: 1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Lawhy committed Nov 23, 2023
1 parent 2385731 commit 9385c3f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 60 deletions.
3 changes: 2 additions & 1 deletion changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,7 @@ <h1 id="changelog">Changelog <img alt="📰" class="twemoji" src="https://cdn.js
<h2 id="unreleased">Unreleased</h2>
<h3 id="added">Added</h3>
<ul class="task-list">
<li class="task-list-item"><label class="task-list-control"><input type="checkbox" disabled checked/><span class="task-list-indicator"></span></label> <strong>Add</strong> empty annotation index warning for BERTMap, related to issue #18.</li>
<li class="task-list-item"><label class="task-list-control"><input type="checkbox" disabled checked/><span class="task-list-indicator"></span></label> <strong>Add</strong> <code>check_consistency()</code> at <code>deeponto.onto.Ontology</code>.</li>
<li class="task-list-item"><label class="task-list-control"><input type="checkbox" disabled checked/><span class="task-list-indicator"></span></label> <strong>Add</strong> a warning message for empty vocab at <code>deeponto.onto.OntologyVerbaliser</code>.</li>
</ul>
Expand Down Expand Up @@ -1511,7 +1512,7 @@ <h2 id="deprecated-before-2023">Deprecated (before 2023)</h2>
<small>

Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">November 13, 2023</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">November 23, 2023</span>

<br>
Created:
Expand Down
62 changes: 33 additions & 29 deletions deeponto/align/bertmap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,9 @@ <h2 id="deeponto.align.bertmap.pipeline.BERTMapPipeline" class="doc doc-heading"
<span class="normal">211</span>
<span class="normal">212</span>
<span class="normal">213</span>
<span class="normal">214</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">src_onto</span><span class="p">:</span> <span class="n">Ontology</span><span class="p">,</span> <span class="n">tgt_onto</span><span class="p">:</span> <span class="n">Ontology</span><span class="p">,</span> <span class="n">config</span><span class="p">:</span> <span class="n">CfgNode</span><span class="p">):</span>
<span class="normal">214</span>
<span class="normal">215</span>
<span class="normal">216</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">src_onto</span><span class="p">:</span> <span class="n">Ontology</span><span class="p">,</span> <span class="n">tgt_onto</span><span class="p">:</span> <span class="n">Ontology</span><span class="p">,</span> <span class="n">config</span><span class="p">:</span> <span class="n">CfgNode</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Initialise the BERTMap or BERTMapLt model.</span>

<span class="sd"> Args:</span>
Expand Down Expand Up @@ -1838,6 +1840,8 @@ <h2 id="deeponto.align.bertmap.pipeline.BERTMapPipeline" class="doc doc-heading"
<span class="c1"># build the annotation thesaurus</span>
<span class="bp">self</span><span class="o">.</span><span class="n">src_annotation_index</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">src_onto</span><span class="o">.</span><span class="n">build_annotation_index</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">annotation_property_iris</span><span class="p">,</span> <span class="n">apply_lowercasing</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">tgt_annotation_index</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">tgt_onto</span><span class="o">.</span><span class="n">build_annotation_index</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">annotation_property_iris</span><span class="p">,</span> <span class="n">apply_lowercasing</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">if</span> <span class="p">(</span><span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">src_annotation_index</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">tgt_annotation_index</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;No class annotations found in input ontologies; unable to produce alignment.&quot;</span><span class="p">)</span>

<span class="c1"># provided mappings if any</span>
<span class="bp">self</span><span class="o">.</span><span class="n">known_mappings</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">known_mappings</span>
Expand Down Expand Up @@ -1981,9 +1985,7 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_or_construct" class

<details class="quote">
<summary>Source code in <code>src/deeponto/align/bertmap/pipeline.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">218</span>
<span class="normal">219</span>
<span class="normal">220</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">220</span>
<span class="normal">221</span>
<span class="normal">222</span>
<span class="normal">223</span>
Expand All @@ -1994,7 +1996,9 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_or_construct" class
<span class="normal">228</span>
<span class="normal">229</span>
<span class="normal">230</span>
<span class="normal">231</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_or_construct</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_file</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">data_name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">construct_func</span><span class="p">:</span> <span class="n">Callable</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="normal">231</span>
<span class="normal">232</span>
<span class="normal">233</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_or_construct</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_file</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">data_name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">construct_func</span><span class="p">:</span> <span class="n">Callable</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Load existing data or construct a new one.</span>

<span class="sd"> An auxlirary function that checks the existence of a data file and loads it if it exists.</span>
Expand Down Expand Up @@ -2032,9 +2036,7 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_text_semantics_corp

<details class="quote">
<summary>Source code in <code>src/deeponto/align/bertmap/pipeline.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">233</span>
<span class="normal">234</span>
<span class="normal">235</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">235</span>
<span class="normal">236</span>
<span class="normal">237</span>
<span class="normal">238</span>
Expand All @@ -2055,7 +2057,9 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_text_semantics_corp
<span class="normal">253</span>
<span class="normal">254</span>
<span class="normal">255</span>
<span class="normal">256</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_text_semantics_corpora</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="normal">256</span>
<span class="normal">257</span>
<span class="normal">258</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_text_semantics_corpora</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Load or construct text semantics corpora.</span>

<span class="sd"> See [`TextSemanticsCorpora`][deeponto.align.bertmap.text_semantics.TextSemanticsCorpora].</span>
Expand Down Expand Up @@ -2107,9 +2111,7 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_finetune_data" clas

<details class="quote">
<summary>Source code in <code>src/deeponto/align/bertmap/pipeline.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">258</span>
<span class="normal">259</span>
<span class="normal">260</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">260</span>
<span class="normal">261</span>
<span class="normal">262</span>
<span class="normal">263</span>
Expand All @@ -2131,7 +2133,9 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_finetune_data" clas
<span class="normal">279</span>
<span class="normal">280</span>
<span class="normal">281</span>
<span class="normal">282</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_finetune_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="normal">282</span>
<span class="normal">283</span>
<span class="normal">284</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_finetune_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">&quot;&quot;&quot;Load or construct fine-tuning data from text semantics corpora.</span>

<span class="sd"> Steps of constructing fine-tuning data from text semantics:</span>
Expand Down Expand Up @@ -2184,9 +2188,7 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_bert_synonym_classi

<details class="quote">
<summary>Source code in <code>src/deeponto/align/bertmap/pipeline.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">284</span>
<span class="normal">285</span>
<span class="normal">286</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">286</span>
<span class="normal">287</span>
<span class="normal">288</span>
<span class="normal">289</span>
Expand All @@ -2209,7 +2211,9 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_bert_synonym_classi
<span class="normal">306</span>
<span class="normal">307</span>
<span class="normal">308</span>
<span class="normal">309</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_bert_synonym_classifier</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="normal">309</span>
<span class="normal">310</span>
<span class="normal">311</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_bert_synonym_classifier</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Load the BERT model from a pre-trained or a local checkpoint.</span>

<span class="sd"> - If loaded from pre-trained, it means to start training from a pre-trained model such as `bert-uncased`.</span>
Expand Down Expand Up @@ -2258,9 +2262,7 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_best_checkpoint" cl

<details class="quote">
<summary>Source code in <code>src/deeponto/align/bertmap/pipeline.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">311</span>
<span class="normal">312</span>
<span class="normal">313</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">313</span>
<span class="normal">314</span>
<span class="normal">315</span>
<span class="normal">316</span>
Expand All @@ -2279,7 +2281,9 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_best_checkpoint" cl
<span class="normal">329</span>
<span class="normal">330</span>
<span class="normal">331</span>
<span class="normal">332</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_best_checkpoint</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span>
<span class="normal">332</span>
<span class="normal">333</span>
<span class="normal">334</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_best_checkpoint</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Find the best checkpoint by searching for trainer states in each checkpoint file.&quot;&quot;&quot;</span>
<span class="n">best_checkpoint</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span>

Expand Down Expand Up @@ -2329,17 +2333,17 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.load_bertmap_config" cla

<details class="quote">
<summary>Source code in <code>src/deeponto/align/bertmap/pipeline.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">334</span>
<span class="normal">335</span>
<span class="normal">336</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">336</span>
<span class="normal">337</span>
<span class="normal">338</span>
<span class="normal">339</span>
<span class="normal">340</span>
<span class="normal">341</span>
<span class="normal">342</span>
<span class="normal">343</span>
<span class="normal">344</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="nd">@staticmethod</span>
<span class="normal">344</span>
<span class="normal">345</span>
<span class="normal">346</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">load_bertmap_config</span><span class="p">(</span><span class="n">config_file</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Load the BERTMap configuration in `.yaml`. If the file</span>
<span class="sd"> is not provided, use the default configuration.</span>
Expand Down Expand Up @@ -2377,11 +2381,11 @@ <h3 id="deeponto.align.bertmap.pipeline.BERTMapPipeline.save_bertmap_config" cla

<details class="quote">
<summary>Source code in <code>src/deeponto/align/bertmap/pipeline.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">346</span>
<span class="normal">347</span>
<span class="normal">348</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">348</span>
<span class="normal">349</span>
<span class="normal">350</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="nd">@staticmethod</span>
<span class="normal">350</span>
<span class="normal">351</span>
<span class="normal">352</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">save_bertmap_config</span><span class="p">(</span><span class="n">config</span><span class="p">:</span> <span class="n">CfgNode</span><span class="p">,</span> <span class="n">config_file</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Save the BERTMap configuration in `.yaml`.&quot;&quot;&quot;</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">config_file</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">c</span><span class="p">:</span>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit 9385c3f

Please sign in to comment.