-
Notifications
You must be signed in to change notification settings - Fork 8
/
usagebox.shtml
44 lines (40 loc) · 2.54 KB
/
usagebox.shtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<div id="usagebox" class="overlay" style="display: none;">
<!-- Button to close the overlay navigation -->
<div class="hidden-overlay" onclick="showUsageBox()"></div>
<a href="javascript:void(0)" class="closebtn" onclick="showUsageBox()">×</a>
<!-- Overlay content -->
<div class="overlay-content" onclick="event.stopPropagation()">
<div class="usage-header">
Load this dataset directly with the Datasets library
</div>
<div class="usage-content">
First, install dependency and clone NusaCrowd
<!-- HTML generated using hilite.me -->
</div>
<div class="usage-content">
<div style="width: 100%; background: #ffffff; overflow:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">pip install datasets</span>
}
<span style="color: #888888">git clone https://github.com/IndoNLP/nusa-crowd.git</span>
</pre></div>
</div>
<div class="usage-content">
<br/>
Then, the dataset can be downloaded locally by the python script below:
</div>
<div class="usage-content">
<div class="usage-code">
<!-- HTML generated using hilite.me --><div class="loading-code" style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">datasets</span> <span style="color: #008800; font-weight: bold">import</span> load_dataset
path <span style="color: #333333">=</span> <span style="background-color: #fff0f0">"nusa-crowd/nusacrowd/nusa_datasets/<span id="dset_name">TMP</span>"</span>
dataset <span style="color: #333333">=</span> load_dataset(path)
<span style="color: #888888"># see dataset sample:</span>
<span style="color: #007020">print</span>(dataset[<span style="background-color: #fff0f0">'train'</span>]<span style="color: #333333">.</span>to_pandas())
</pre></div>
</div>
<div class="usage-copy">
<button id="copy-button" class="btn" onclick="copyText()"><i class="fa fa-copy" onclick="copyText()"></i></button>
<div id="copy-text">Copied!</div>
</div>
</div>
</div>
</div>
</div>