Skip to content

Commit

Permalink
deploy: 8a4e61c
Browse files Browse the repository at this point in the history
  • Loading branch information
shenxiangzhuang committed Apr 26, 2024
0 parents commit 7df8ab0
Show file tree
Hide file tree
Showing 65 changed files with 1,981 additions and 0 deletions.
Empty file added .lock
Empty file.
Empty file added .nojekyll
Empty file.
2 changes: 2 additions & 0 deletions bleuscore/all.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-5bc39a1768837dd0.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bleuscore" data-themes="" data-resource-suffix="" data-rustdoc-version="1.77.2 (25ef9e3d8 2024-04-09)" data-channel="1.77.2" data-search-js="search-dd67cee4cfa65049.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-4c98445ec4002617.js"></script><script defer src="../static.files/main-48f368f3872407c8.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-04d5337699b92874.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bleuscore/index.html">bleuscore</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></section></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../bleuscore/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><h1>List of all items</h1><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.BleuScore.html">BleuScore</a></li><li><a href="struct.Tokenizer13a.html">Tokenizer13a</a></li><li><a href="struct.TokenizerRegex.html">TokenizerRegex</a></li></ul><h3 id="traits">Traits</h3><ul class="all-items"><li><a href="trait.Tokenizer.html">Tokenizer</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="fn.compute_score.html">compute_score</a></li></ul></section></div></main></body></html>
11 changes: 11 additions & 0 deletions bleuscore/bleu/fn.compute_score.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bleuscore/fn.compute_score.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bleuscore/fn.compute_score.html">../../bleuscore/fn.compute_score.html</a>...</p>
<script>location.replace("../../bleuscore/fn.compute_score.html" + location.search + location.hash);</script>
</body>
</html>
11 changes: 11 additions & 0 deletions bleuscore/bleu/struct.BleuScore.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bleuscore/struct.BleuScore.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bleuscore/struct.BleuScore.html">../../bleuscore/struct.BleuScore.html</a>...</p>
<script>location.replace("../../bleuscore/struct.BleuScore.html" + location.search + location.hash);</script>
</body>
</html>
9 changes: 9 additions & 0 deletions bleuscore/fn.compute_score.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="compute the BLEU score with `Tokenizer13a` as default tokenizer. The implementation is based on huggingface/nmt"><title>compute_score in bleuscore - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-5bc39a1768837dd0.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bleuscore" data-themes="" data-resource-suffix="" data-rustdoc-version="1.77.2 (25ef9e3d8 2024-04-09)" data-channel="1.77.2" data-search-js="search-dd67cee4cfa65049.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-4c98445ec4002617.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-48f368f3872407c8.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-04d5337699b92874.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bleuscore/index.html">bleuscore</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../bleuscore/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="index.html">bleuscore</a>::<wbr><a class="fn" href="#">compute_score</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/bleuscore/bleu.rs.html#19-119">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub fn compute_score(
references: <a class="struct" href="https://doc.rust-lang.org/1.77.2/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.77.2/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.77.2/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;,
predictions: <a class="struct" href="https://doc.rust-lang.org/1.77.2/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.77.2/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;,
max_order: <a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>,
smooth: <a class="primitive" href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>
) -&gt; <a class="struct" href="struct.BleuScore.html" title="struct bleuscore::BleuScore">BleuScore</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>compute the BLEU score with <code>Tokenizer13a</code> as default tokenizer.
The implementation is based on <a href="https://github.com/huggingface/evaluate/blob/main/metrics/bleu/bleu.py">huggingface/nmt</a></p>
</div></details></section></div></main></body></html>
30 changes: 30 additions & 0 deletions bleuscore/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="bleuscore is a BLEU score calculator written in pure rust."><title>bleuscore - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-5bc39a1768837dd0.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bleuscore" data-themes="" data-resource-suffix="" data-rustdoc-version="1.77.2 (25ef9e3d8 2024-04-09)" data-channel="1.77.2" data-search-js="search-dd67cee4cfa65049.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-4c98445ec4002617.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-48f368f3872407c8.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-04d5337699b92874.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bleuscore/index.html">bleuscore</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"><ul class="block">
<li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></section></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../bleuscore/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Crate <a class="mod" href="#">bleuscore</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/bleuscore/lib.rs.html#1-92">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>bleuscore is a <a href="https://en.wikipedia.org/wiki/BLEU">BLEU</a> score calculator written in pure rust.</p>
<h2 id="install"><a class="doc-anchor" href="#install">§</a>Install:</h2>
<p>The crate is called <code>bleuscore</code> and you can depend on it via cargo:</p>
<div class="example-wrap"><pre class="language-ini"><code>[dependencies]
bleuscore = &quot;*&quot;
</code></pre></div><h2 id="features"><a class="doc-anchor" href="#features">§</a>Features:</h2>
<ul>
<li>Tokenized BLEU score calculation like
<a href="https://github.com/huggingface/evaluate/blob/main/metrics/bleu/bleu.py">huggingface evaluate</a>
and <a href="https://github.com/mjpost/sacrebleu">sacrebleu</a></li>
</ul>
<h2 id="basic-usage"><a class="doc-anchor" href="#basic-usage">§</a>Basic usage:</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// get the references and prediction data:
</span><span class="kw">let </span>references: Vec&lt;Vec&lt;String&gt;&gt; = <span class="macro">vec!</span>[<span class="macro">vec!</span>[<span class="string">"Hello, World!"</span>.to_string()]];
<span class="kw">let </span>predictions: Vec&lt;String&gt; = <span class="macro">vec!</span>[<span class="string">"Yellow, World!"</span>.to_string()];

<span class="comment">// set the parameters:
</span><span class="kw">let </span>max_order: usize = <span class="number">4</span>;
<span class="kw">let </span>smooth: bool = <span class="bool-val">true</span>;

<span class="comment">// calculate the BLEU score:
</span><span class="kw">let </span>res = compute_score(references, predictions, max_order, smooth);
<span class="macro">println!</span>(<span class="string">"result: {:?}"</span>, res);
<span class="comment">// result: BleuScore { bleu: 0.668740304976422, precisions: [0.8, 0.75, 0.6666666666666666, 0.5],
// brevity_penalty: 1.0, length_ratio: 1.0, translation_length: 4, reference_length: 4 }</span></code></pre></div>
<p>!</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.BleuScore.html" title="struct bleuscore::BleuScore">BleuScore</a></div><div class="desc docblock-short">The BLEU score data struct</div></li><li><div class="item-name"><a class="struct" href="struct.Tokenizer13a.html" title="struct bleuscore::Tokenizer13a">Tokenizer13a</a></div><div class="desc docblock-short">Same implementation with <a href="https://github.com/huggingface/evaluate/blob/main/metrics/bleu/tokenizer_13a.py">huggingface/sacrebleu</a></div></li><li><div class="item-name"><a class="struct" href="struct.TokenizerRegex.html" title="struct bleuscore::TokenizerRegex">TokenizerRegex</a></div><div class="desc docblock-short">Same implementation with <a href="https://github.com/huggingface/evaluate/blob/main/metrics/bleu/tokenizer_13a.py">huggingface/sacrebleu</a></div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.Tokenizer.html" title="trait bleuscore::Tokenizer">Tokenizer</a></div><div class="desc docblock-short">tokenize function is used to tokenize the strings</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.compute_score.html" title="fn bleuscore::compute_score">compute_score</a></div><div class="desc docblock-short">compute the BLEU score with <code>Tokenizer13a</code> as default tokenizer.
The implementation is based on <a href="https://github.com/huggingface/evaluate/blob/main/metrics/bleu/bleu.py">huggingface/nmt</a></div></li></ul></section></div></main></body></html>
1 change: 1 addition & 0 deletions bleuscore/sidebar-items.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7df8ab0

Please sign in to comment.