Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
labmlai
GitHub Repository: labmlai/annotated_deep_learning_paper_implementations
Path: blob/master/translate_cache/experiments/nlp_classification.ja.json
4923 views
1
{
2
"<h1>NLP model trainer for classification</h1>\n": "<h1>\u5206\u985e\u7528 NLP \u30e2\u30c7\u30eb\u30c8\u30ec\u30fc\u30ca\u30fc</h1>\n",
3
"<h2>Function to load data into batches</h2>\n": "<h2>\u30c7\u30fc\u30bf\u3092\u30d0\u30c3\u30c1\u306b\u30ed\u30fc\u30c9\u3059\u308b\u6a5f\u80fd</h2>\n",
4
"<h3>AG News dataset</h3>\n<p>This loads the AG News dataset and the set the values for <span translate=no>_^_0_^_</span>, <span translate=no>_^_1_^_</span>, <span translate=no>_^_2_^_</span>, and <span translate=no>_^_3_^_</span>.</p>\n": "<h3>AG \u30cb\u30e5\u30fc\u30b9\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8</h3>\n<p>\u3053\u308c\u306b\u3088\u308a AG News \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304c\u8aad\u307f\u8fbc\u307e\u308c<span translate=no>_^_0_^_</span>\u3001\u3001<span translate=no>_^_1_^_</span><span translate=no>_^_2_^_</span>\u3001<span translate=no>_^_3_^_</span>\u306e\u5024\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002</p>\n",
5
"<h3>Basic english tokenizer</h3>\n<p>We use character level tokenizer in this experiment. You can switch by setting,</p>\n<span translate=no>_^_0_^_</span><p>in the configurations dictionary when starting the experiment.</p>\n": "<h3>\u30d9\u30fc\u30b7\u30c3\u30af\u30fb\u30a4\u30f3\u30b0\u30ea\u30c3\u30b7\u30e5\u30fb\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc</h3>\n<p>\u3053\u306e\u5b9f\u9a13\u3067\u306f\u3001\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u30ec\u30d9\u30eb\u306e\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u8a2d\u5b9a\u3067\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001</p>\n<span translate=no>_^_0_^_</span><p>\u5b9f\u9a13\u3092\u958b\u59cb\u3059\u308b\u3068\u304d\u306b\u69cb\u6210\u8f9e\u66f8\u306b\u3042\u308a\u307e\u3059\u3002</p>\n",
6
"<h3>Character level tokenizer</h3>\n": "<h3>\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u30ec\u30d9\u30eb\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc</h3>\n",
7
"<h3>Default <a href=\"../optimizers/configs.html\">optimizer configurations</a></h3>\n": "<h3><a href=\"../optimizers/configs.html\">\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u30fc\u69cb\u6210</a></h3>\n",
8
"<h3>Initialization</h3>\n": "<h3>\u521d\u671f\u5316</h3>\n",
9
"<h3>Training or validation step</h3>\n": "<h3>\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u307e\u305f\u306f\u691c\u8a3c\u30b9\u30c6\u30c3\u30d7</h3>\n",
10
"<p> </p>\n": "<p></p>\n",
11
"<p> <a id=\"NLPClassificationConfigs\"></a></p>\n<h2>Trainer configurations</h2>\n<p>This has the basic configurations for NLP classification task training. All the properties are configurable.</p>\n": "<p><a id=\"NLPClassificationConfigs\"></a></p>\n<h2>\u30c8\u30ec\u30fc\u30ca\u30fc\u69cb\u6210</h2>\n<p>\u3053\u308c\u306b\u306f\u3001NLP\u5206\u985e\u30bf\u30b9\u30af\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u306e\u57fa\u672c\u7684\u306a\u69cb\u6210\u304c\u3042\u308a\u307e\u3059\u3002\u3059\u3079\u3066\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u8a2d\u5b9a\u53ef\u80fd\u3067\u3059\u3002</p>\n",
12
"<p> Character level tokenizer configuration</p>\n": "<p>\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u30ec\u30d9\u30eb\u306e\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u8a2d\u5b9a</p>\n",
13
"<p> Get number of tokens</p>\n": "<p>\u30c8\u30fc\u30af\u30f3\u306e\u6570\u3092\u53d6\u5f97</p>\n",
14
"<p>Accuracy function </p>\n": "<p>\u7cbe\u5ea6\u6a5f\u80fd</p>\n",
15
"<p>Add a hook to log module outputs </p>\n": "<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u51fa\u529b\u3092\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u30d5\u30c3\u30af\u3092\u8ffd\u52a0</p>\n",
16
"<p>Add accuracy as a state module. The name is probably confusing, since it&#x27;s meant to store states between training and validation for RNNs. This will keep the accuracy metric stats separate for training and validation. </p>\n": "<p>\u30b9\u30c6\u30fc\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u3057\u3066\u7cbe\u5ea6\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u540d\u524d\u306f\u3001RNN \u306e\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3068\u691c\u8a3c\u306e\u9593\u306e\u72b6\u614b\u3092\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u306a\u306e\u3067\u3001\u304a\u305d\u3089\u304f\u308f\u304b\u308a\u306b\u304f\u3044\u3067\u3057\u3087\u3046\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u7cbe\u5ea6\u6307\u6a19\u306e\u7d71\u8a08\u60c5\u5831\u304c\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u7528\u3068\u691c\u8a3c\u7528\u306b\u5225\u3005\u306b\u4fdd\u6301\u3055\u308c\u307e\u3059\u3002</p>\n",
17
"<p>Autoregressive model </p>\n": "<p>\u81ea\u5df1\u56de\u5e30\u30e2\u30c7\u30eb</p>\n",
18
"<p>Batch size </p>\n": "<p>\u30d0\u30c3\u30c1\u30b5\u30a4\u30ba</p>\n",
19
"<p>Calculate and log accuracy </p>\n": "<p>\u7cbe\u5ea6\u306e\u8a08\u7b97\u3068\u8a18\u9332</p>\n",
20
"<p>Calculate and log loss </p>\n": "<p>\u640d\u5931\u306e\u8a08\u7b97\u3068\u8a18\u9332</p>\n",
21
"<p>Calculate gradients </p>\n": "<p>\u52fe\u914d\u306e\u8a08\u7b97</p>\n",
22
"<p>Clear the gradients </p>\n": "<p>\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u30af\u30ea\u30a2</p>\n",
23
"<p>Clip gradients </p>\n": "<p>\u30af\u30ea\u30c3\u30d7\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3</p>\n",
24
"<p>Collect tokens from training dataset </p>\n": "<p>\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304b\u3089\u30c8\u30fc\u30af\u30f3\u3092\u53ce\u96c6</p>\n",
25
"<p>Collect tokens from validation dataset </p>\n": "<p>\u691c\u8a3c\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304b\u3089\u30c8\u30fc\u30af\u30f3\u3092\u53ce\u96c6</p>\n",
26
"<p>Create <a href=\"../utils.html#map_style_dataset\">map-style datasets</a> </p>\n": "<p><a href=\"../utils.html#map_style_dataset\">\u30de\u30c3\u30d7\u30b9\u30bf\u30a4\u30eb\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u4f5c\u6210</a></p>\n",
27
"<p>Create a counter </p>\n": "<p>\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u4f5c\u6210</p>\n",
28
"<p>Create training data loader </p>\n": "<p>\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c7\u30fc\u30bf\u30ed\u30fc\u30c0\u30fc\u306e\u4f5c\u6210</p>\n",
29
"<p>Create validation data loader </p>\n": "<p>\u691c\u8a3c\u30c7\u30fc\u30bf\u30ed\u30fc\u30c0\u30fc\u306e\u4f5c\u6210</p>\n",
30
"<p>Create vocabulary </p>\n": "<p>\u30dc\u30ad\u30e3\u30d6\u30e9\u30ea\u30fc\u306e\u4f5c\u6210</p>\n",
31
"<p>Empty labels tensor </p>\n": "<p>\u7a7a\u30e9\u30d9\u30eb\u30c6\u30f3\u30bd\u30eb</p>\n",
32
"<p>Get model outputs. It&#x27;s returning a tuple for states when using RNNs. This is not implemented yet. \ud83d\ude1c </p>\n": "<p>\u30e2\u30c7\u30eb\u51fa\u529b\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002RNN \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u30b9\u30c6\u30fc\u30c8\u306e\u30bf\u30d7\u30eb\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u307e\u3060\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\ud83d\ude1c</p>\n",
33
"<p>Get tokenizer </p>\n": "<p>\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u3092\u5165\u624b</p>\n",
34
"<p>Get training and validation datasets </p>\n": "<p>\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3068\u691c\u8a3c\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u5165\u624b</p>\n",
35
"<p>Gradient clipping </p>\n": "<p>\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u30af\u30ea\u30c3\u30d4\u30f3\u30b0</p>\n",
36
"<p>Input data tensor, initialized with <span translate=no>_^_0_^_</span> </p>\n": "<p>\u3067\u521d\u671f\u5316\u3055\u308c\u305f\u5165\u529b\u30c7\u30fc\u30bf\u30c6\u30f3\u30bd\u30eb <span translate=no>_^_0_^_</span></p>\n",
37
"<p>Length of the sequence, or context size </p>\n": "<p>\u30b7\u30fc\u30b1\u30f3\u30b9\u306e\u9577\u3055\u3001\u307e\u305f\u306f\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30b5\u30a4\u30ba</p>\n",
38
"<p>Load data to memory </p>\n": "<p>\u30c7\u30fc\u30bf\u3092\u30e1\u30e2\u30ea\u306b\u8aad\u307f\u8fbc\u3080</p>\n",
39
"<p>Log the model parameters and gradients on last batch of every epoch </p>\n": "<p>\u5404\u30a8\u30dd\u30c3\u30af\u306e\u6700\u5f8c\u306e\u30d0\u30c3\u30c1\u3067\u30e2\u30c7\u30eb\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u52fe\u914d\u3092\u8a18\u9332\u3057\u307e\u3059</p>\n",
40
"<p>Loop through the samples </p>\n": "<p>\u30b5\u30f3\u30d7\u30eb\u3092\u30eb\u30fc\u30d7\u51e6\u7406</p>\n",
41
"<p>Loss function </p>\n": "<p>\u640d\u5931\u95a2\u6570</p>\n",
42
"<p>Model embedding size </p>\n": "<p>\u30e2\u30c7\u30eb\u57cb\u3081\u8fbc\u307f\u30b5\u30a4\u30ba</p>\n",
43
"<p>Move data to the device </p>\n": "<p>\u30c7\u30fc\u30bf\u3092\u30c7\u30d0\u30a4\u30b9\u306b\u79fb\u52d5</p>\n",
44
"<p>Number of classes </p>\n": "<p>\u30af\u30e9\u30b9\u6570</p>\n",
45
"<p>Number of token in vocabulary </p>\n": "<p>\u30dc\u30ad\u30e3\u30d6\u30e9\u30ea\u30fc\u5185\u306e\u30c8\u30fc\u30af\u30f3\u306e\u6570</p>\n",
46
"<p>Optimizer </p>\n": "<p>\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u30fc</p>\n",
47
"<p>Return <span translate=no>_^_0_^_</span>, <span translate=no>_^_1_^_</span>, <span translate=no>_^_2_^_</span>, and <span translate=no>_^_3_^_</span> </p>\n": "<p>\u30ea\u30bf\u30fc\u30f3<span translate=no>_^_0_^_</span><span translate=no>_^_1_^_</span>\u3001<span translate=no>_^_2_^_</span>\u3001\u3001<span translate=no>_^_3_^_</span></p>\n",
48
"<p>Save the tracked metrics </p>\n": "<p>\u8ffd\u8de1\u3057\u305f\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u4fdd\u5b58\u3059\u308b</p>\n",
49
"<p>Set the final token in the sequence to <span translate=no>_^_0_^_</span> </p>\n": "<p>\u30b7\u30fc\u30b1\u30f3\u30b9\u306e\u6700\u5f8c\u306e\u30c8\u30fc\u30af\u30f3\u3092\u6b21\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<span translate=no>_^_0_^_</span></p>\n",
50
"<p>Set the label </p>\n": "<p>\u30e9\u30d9\u30eb\u3092\u8a2d\u5b9a</p>\n",
51
"<p>Set tracker configurations </p>\n": "<p>\u30c8\u30e9\u30c3\u30ab\u30fc\u69cb\u6210\u3092\u8a2d\u5b9a</p>\n",
52
"<p>Take optimizer step </p>\n": "<p>\u6700\u9069\u5316\u306e\u4e00\u6b69\u3092\u8e0f\u307f\u51fa\u3059</p>\n",
53
"<p>Tokenize the input text </p>\n": "<p>\u5165\u529b\u30c6\u30ad\u30b9\u30c8\u3092\u30c8\u30fc\u30af\u30f3\u5316</p>\n",
54
"<p>Tokenizer </p>\n": "<p>\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc</p>\n",
55
"<p>Train the model </p>\n": "<p>\u30e2\u30c7\u30eb\u306e\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0</p>\n",
56
"<p>Training data loader </p>\n": "<p>\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c7\u30fc\u30bf\u30ed\u30fc\u30c0\u30fc</p>\n",
57
"<p>Training device </p>\n": "<p>\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9</p>\n",
58
"<p>Transpose and add to data </p>\n": "<p>\u8ee2\u7f6e\u3057\u3066\u30c7\u30fc\u30bf\u306b\u8ffd\u52a0</p>\n",
59
"<p>Truncate upto <span translate=no>_^_0_^_</span> </p>\n": "<p>\u6700\u5927\u307e\u3067\u5207\u308a\u6368\u3066 <span translate=no>_^_0_^_</span></p>\n",
60
"<p>Update global step (number of tokens processed) when in training mode </p>\n": "<p>\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30e2\u30fc\u30c9\u6642\u306b\u30b0\u30ed\u30fc\u30d0\u30eb\u30b9\u30c6\u30c3\u30d7 (\u51e6\u7406\u3055\u308c\u305f\u30c8\u30fc\u30af\u30f3\u306e\u6570) \u3092\u66f4\u65b0</p>\n",
61
"<p>Validation data loader </p>\n": "<p>\u691c\u8a3c\u30c7\u30fc\u30bf\u30ed\u30fc\u30c0\u30fc</p>\n",
62
"<p>Vocabulary </p>\n": "<p>\u8a9e\u5f59</p>\n",
63
"<p>Whether to capture model outputs </p>\n": "<p>\u30e2\u30c7\u30eb\u51fa\u529b\u3092\u30ad\u30e3\u30d7\u30c1\u30e3\u3059\u308b\u304b\u3069\u3046\u304b</p>\n",
64
"<p>Whether to log model activations (once per epoch). These are summarized stats per layer, but it could still lead to many indicators for very deep networks. </p>\n": "<p>\u30e2\u30c7\u30eb\u306e\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30b7\u30e7\u30f3\u3092\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u304b\u3069\u3046\u304b (\u30a8\u30dd\u30c3\u30af\u3054\u3068\u306b 1 \u56de)\u3002\u3053\u308c\u3089\u306f\u30ec\u30a4\u30e4\u30fc\u3054\u3068\u306e\u7d71\u8a08\u60c5\u5831\u3092\u307e\u3068\u3081\u305f\u3082\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u3082\u975e\u5e38\u306b\u6df1\u3044\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u591a\u304f\u306e\u6307\u6a19\u306b\u3064\u306a\u304c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059</p>\u3002\n",
65
"<p>Whether to log model parameters and gradients (once per epoch). These are summarized stats per layer, but it could still lead to many indicators for very deep networks. </p>\n": "<p>\u30e2\u30c7\u30eb\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3068\u52fe\u914d\u3092\u8a18\u9332\u3059\u308b\u304b\u3069\u3046\u304b (\u30a8\u30dd\u30c3\u30af\u3054\u3068\u306b 1 \u56de)\u3002\u3053\u308c\u3089\u306f\u30ec\u30a4\u30e4\u30fc\u3054\u3068\u306e\u7d71\u8a08\u60c5\u5831\u3092\u307e\u3068\u3081\u305f\u3082\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u3082\u975e\u5e38\u306b\u6df1\u3044\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u591a\u304f\u306e\u6307\u6a19\u306b\u3064\u306a\u304c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059</p>\u3002\n",
66
"<p>Whether to periodically save models </p>\n": "<p>\u30e2\u30c7\u30eb\u3092\u5b9a\u671f\u7684\u306b\u4fdd\u5b58\u3059\u308b\u304b\u3069\u3046\u304b</p>\n",
67
"<ul><li><span translate=no>_^_0_^_</span> is the batch of data collected by the <span translate=no>_^_1_^_</span></li></ul>\n": "<ul><li><span translate=no>_^_0_^_</span>\u304c\u53ce\u96c6\u3057\u305f\u30c7\u30fc\u30bf\u306e\u30d0\u30c3\u30c1\u3067\u3059 <span translate=no>_^_1_^_</span></li></ul>\n",
68
"<ul><li><span translate=no>_^_0_^_</span> is the tokenizer function </li>\n<li><span translate=no>_^_1_^_</span> is the vocabulary </li>\n<li><span translate=no>_^_2_^_</span> is the length of the sequence </li>\n<li><span translate=no>_^_3_^_</span> is the token used for padding when the <span translate=no>_^_4_^_</span> is larger than the text length </li>\n<li><span translate=no>_^_5_^_</span> is the <span translate=no>_^_6_^_</span> token which we set at end of the input</li></ul>\n": "<ul><li><span translate=no>_^_0_^_</span>\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u95a2\u6570\u3067\u3059</li>\n<li><span translate=no>_^_1_^_</span>\u306f\u30dc\u30ad\u30e3\u30d6\u30e9\u30ea\u30fc</li>\n<li><span translate=no>_^_2_^_</span>\u30b7\u30fc\u30b1\u30f3\u30b9\u306e\u9577\u3055\u3067\u3059</li>\n<li><span translate=no>_^_3_^_</span><span translate=no>_^_4_^_</span>\u304c\u30c6\u30ad\u30b9\u30c8\u306e\u9577\u3055\u3088\u308a\u5927\u304d\u3044\u5834\u5408\u306b\u30d1\u30c7\u30a3\u30f3\u30b0\u306b\u4f7f\u7528\u3055\u308c\u308b\u30c8\u30fc\u30af\u30f3\u3067\u3059</li>\n<li><span translate=no>_^_5_^_</span><span translate=no>_^_6_^_</span>\u5165\u529b\u306e\u6700\u5f8c\u306b\u8a2d\u5b9a\u3057\u305f\u30c8\u30fc\u30af\u30f3\u3067\u3059</li></ul>\n",
69
"NLP classification trainer": "NLP \u5206\u985e\u30c8\u30ec\u30fc\u30ca\u30fc",
70
"This is a reusable trainer for classification tasks": "\u3053\u308c\u306f\u5206\u985e\u4f5c\u696d\u7528\u306e\u518d\u5229\u7528\u53ef\u80fd\u306a\u30c8\u30ec\u30fc\u30ca\u30fc\u3067\u3059"
71
}
72