dahara1 commited on
Commit
6e401cf
·
verified ·
1 Parent(s): 7b47377

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +58 -167
README.md CHANGED
@@ -9,9 +9,11 @@ tags:
9
  ---
10
  # Model Card for gemma-2-2b-jpn-it-translate
11
 
12
- gemma-2-2b-jpn-it-translateは、日英・英日翻訳タスクに特化したSLM(Small Language Model)です。パラメーター数は20億(2B)ですが、従来の70億(7B)モデルに迫るレベルの翻訳品質を提供します。ファイルサイズが約5GBと比較的小さいため、高速な実行が可能です。
 
13
 
14
- gemma-2-2b-jpn-it-translate is an SLM (Small Language Model) specialized for Japanese-English and English-Japanese translation tasks. Despite having only 2 billion parameters (2B), it provides translation quality approaching that of conventional 7 billion (7B) parameter models. With a relatively small file size of about 5GB, it enables fast execution.
 
15
 
16
  ## モデル詳細 Model Details
17
 
@@ -26,10 +28,29 @@ gemma-2-2b-jpn-it-translate is an SLM (Small Language Model) specialized for Jap
26
  This model is fine-tuned from "gemma-2-2b-jpn-it", a Japanese-specific model released by Google.
27
  Our goal is to translate texts of unlimited length at high speed.
28
  It is trained to output translated text (Japanese/English) in response to user input after being given an initial system prompt-like text (Japanese/English).
29
- Additionally, by using apply_chat_template, it eliminates the need for manual writing of prompt templates, which can be prone to errors.
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  ### 日英翻訳用サンプルコード Japanese-English Translation sample script.
32
 
 
 
 
 
 
 
 
 
33
  '''
34
  pip install -U transformers
35
  '''
@@ -304,175 +325,45 @@ CEO, XYZ Corporation"""
304
 
305
  結果 result
306
  ```
307
- ['貴社にご愛顧いただき、誠にありがとうございます。', 'このメールがご健在であることを心よりお祈り申し上げます。', '弊社の最近の進展と今後の計画について、重要なお知らせをご提供いたします。', 'まず、第3四半期の収益が予想を上回ったことをお知らせいたします。昨年の同時期と比較して、売上高が15%増加しました。', 'この成功は、新製品ラインの発売と、新興市場へのサービスの拡大が大きく貢献しています。', 'この成長を踏まえ、今後の数ヶ月にわたって、いくつかの戦略的イニシアテ��ブを実施する予定です。', '1', 'R&D部門の拡大:市場での競争力を維持するために、大幅に研究開発に投資する予定です。', '2', 'サステナビリティの取り組み:次の5年間で、炭素排出量を30%削減することを目指しています。', 'これは、再生可能エネルギー源への移行と、すべての事業活動における環境にやさしい実践の導入を含むものです。', '3', 'デジタルトランスフォーメーション: 私たちのITインフラを強化し、効率を向上させ、より良いサービスを提供する', 'さらに、今年は新型コロナウイルス感染症の懸念が続くため、オンラインで開催されますが、毎年恒例の年次カンファレンスをお知らせいたします。', 'カンファレンスは2024年11月15日~16日に開催され、業界のリーダーによるキーノートスピーチ、インタラクティブワークショップ、ネットワークングの機会が盛りだくさんです。', '引き続きご支援とご協力を賜りますようお願い申し上げます。', 'これらのイニシアチブについてご質問がある場合や、さらに詳しい情報をご希望の場合は、ご担当マネジャーにご連絡するか、弊社のカスタマーサポートチームにご連絡ください。', '弊社の信頼を賜り、誠にありがとうございます。', '共に新たな目標を達成できることを楽しみにしています。', 'ご清栄のこととお慶び申し上げます。', 'ジョン・スミス', 'XYZ株式会社のCEO']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  ```
309
 
 
310
 
 
 
311
 
312
- 制限
313
-
314
- 空行を渡すと翻訳をせずに元文をそのまま出力してしまう減少が確認されています
315
-
316
- <!-- Provide a longer summary of what this model is. -->
317
-
318
-
319
-
320
- - **Developed by:** [More Information Needed]
321
- - **Funded by [optional]:** [More Information Needed]
322
- - **Shared by [optional]:** [More Information Needed]
323
- - **Model type:** [More Information Needed]
324
- - **Language(s) (NLP):** [More Information Needed]
325
- - **License:** [More Information Needed]
326
- - **Finetuned from model [optional]:** [More Information Needed]
327
-
328
- ### Model Sources [optional]
329
-
330
- <!-- Provide the basic links for the model. -->
331
-
332
- - **Repository:** [More Information Needed]
333
- - **Paper [optional]:** [More Information Needed]
334
- - **Demo [optional]:** [More Information Needed]
335
-
336
- ## Uses
337
-
338
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
339
-
340
- ### Direct Use
341
-
342
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
343
-
344
- [More Information Needed]
345
-
346
- ### Downstream Use [optional]
347
-
348
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
349
-
350
- [More Information Needed]
351
-
352
- ### Out-of-Scope Use
353
-
354
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
355
-
356
- [More Information Needed]
357
-
358
- ## Bias, Risks, and Limitations
359
-
360
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
361
-
362
- [More Information Needed]
363
-
364
- ### Recommendations
365
-
366
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
367
-
368
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
369
-
370
- ## How to Get Started with the Model
371
-
372
- Use the code below to get started with the model.
373
-
374
- [More Information Needed]
375
-
376
- ## Training Details
377
-
378
- ### Training Data
379
-
380
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
381
-
382
- [More Information Needed]
383
-
384
- ### Training Procedure
385
-
386
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
387
-
388
- #### Preprocessing [optional]
389
-
390
- [More Information Needed]
391
-
392
-
393
- #### Training Hyperparameters
394
-
395
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
396
-
397
- #### Speeds, Sizes, Times [optional]
398
-
399
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
400
-
401
- [More Information Needed]
402
-
403
- ## Evaluation
404
-
405
- <!-- This section describes the evaluation protocols and provides the results. -->
406
-
407
- ### Testing Data, Factors & Metrics
408
-
409
- #### Testing Data
410
-
411
- <!-- This should link to a Dataset Card if possible. -->
412
-
413
- [More Information Needed]
414
-
415
- #### Factors
416
-
417
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
418
-
419
- [More Information Needed]
420
-
421
- #### Metrics
422
-
423
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
424
-
425
- [More Information Needed]
426
-
427
- ### Results
428
-
429
- [More Information Needed]
430
-
431
- #### Summary
432
-
433
-
434
-
435
- ## Model Examination [optional]
436
-
437
- <!-- Relevant interpretability work for the model goes here -->
438
-
439
- [More Information Needed]
440
-
441
- ## Environmental Impact
442
-
443
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
444
-
445
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
446
-
447
- - **Hardware Type:** [More Information Needed]
448
- - **Hours used:** [More Information Needed]
449
- - **Cloud Provider:** [More Information Needed]
450
- - **Compute Region:** [More Information Needed]
451
- - **Carbon Emitted:** [More Information Needed]
452
 
 
 
 
453
 
454
  **BibTeX:**
 
 
 
 
 
 
 
 
 
 
455
 
456
- [More Information Needed]
457
-
458
- **APA:**
459
-
460
- [More Information Needed]
461
-
462
- ## Glossary [optional]
463
-
464
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
465
-
466
- [More Information Needed]
467
-
468
- ## More Information [optional]
469
-
470
- [More Information Needed]
471
-
472
- ## Model Card Authors [optional]
473
-
474
- [More Information Needed]
475
-
476
- ## Model Card Contact
477
-
478
- [More Information Needed]
 
9
  ---
10
  # Model Card for gemma-2-2b-jpn-it-translate
11
 
12
+ gemma-2-2b-jpn-it-translateは、googleが公開してくれた[google/gemma-2-2b-jpn-it](https://huggingface.co/google/gemma-2-2b-jpn-it)を翻訳タスク用にチューニングしたモデルです
13
+ gemma-2-2b-jpn-it-translate is a model tuned for translation tasks based on [google/gemma-2-2b-jpn-it](https://huggingface.co/google/gemma-2-2b-jpn-it) released by Google.
14
 
15
+ パラメーター数は20億(2B)ですが、分野によっては1年前の70億(7B)モデルに迫るレベルの翻訳品質を提供します。ファイルサイズが約5GBと比較的小さいため、高速な実行が可能です。
16
+ Although it has 2 billion (2B) parameters, in some fields it provides translation quality approaching that of the 7 billion (7B) model from a year ago. The file size is relatively small at around 5GB, allowing for fast execution.
17
 
18
  ## モデル詳細 Model Details
19
 
 
28
  This model is fine-tuned from "gemma-2-2b-jpn-it", a Japanese-specific model released by Google.
29
  Our goal is to translate texts of unlimited length at high speed.
30
  It is trained to output translated text (Japanese/English) in response to user input after being given an initial system prompt-like text (Japanese/English).
31
+ Additionally, by using apply_chat_template, it eliminates the need for manual writing of prompt templates, which can be prone to errors.
32
+
33
+ 文単位で翻訳する事を学習しているため、改行を含む長文を一度に渡すと品質が低下します。
34
+ 長文を翻訳する際は文単位で区切る前処理をしてからモデルに与えてください。
35
+ Because the model is trained to translate sentence by sentence, passing a long sentence with line breaks at once will result in a decrease in quality.
36
+ When translating a long sentence, please pre-process it by dividing it into sentences before feeding it to the model.
37
+
38
+ ### 一括翻訳用サンプルColabスクリプト
39
+
40
+ Googleアカウントをお持ちの方は下記のリンク先で「Open In Colab」ボタンを押すと無料で確かめる事ができます。
41
+ If you have a Google account, you can check it out for free by clicking the "Open In Colab" button at the link below.
42
+ [gemma_2_2b_jpn_it_tranlate_batch_translation_sample.ipynb](https://github.com/webbigdata-jp/python_sample/blob/main/gemma_2_2b_jpn_it_tranlate_batch_translation_sample.ipynb)
43
 
44
  ### 日英翻訳用サンプルコード Japanese-English Translation sample script.
45
 
46
+ GPU付きのパソコンをお持ちの方は以下のスクリプトを参考に動作させる事ができます
47
+ GPU付きのパソコンをお持ちでない方は[gguf版モデル](https://huggingface.co/webbigdata/gemma-2-2b-jpn-it-translate-gguf)をお試しください
48
+ 下記のサンプルスクリプトは文単位に区切る部分の実装が完全なコードではないので用途に合わせて修正してください
49
+
50
+ If you have a computer with a GPU, you can use the following script as a reference.
51
+ If you don't have a computer with a GPU, try the [gguf model](https://huggingface.co/webbigdata/gemma-2-2b-jpn-it-translate-gguf).
52
+ The sample script below does not have a complete implementation of the part that separates sentences, so please modify it to suit your needs.
53
+
54
  '''
55
  pip install -U transformers
56
  '''
 
325
 
326
  結果 result
327
  ```
328
+ ['貴社にご愛顧いただき、誠にありがとうございます。', 'このメールがご健在であることを心よりお祈り申し上げます。',
329
+ '弊社の最近の進展と今後の計画について、重要なお知らせをご提供いたします。',
330
+ 'まず、第3四半期の収益が予想を上回ったことをお知らせいたします。昨年の同時期と比較して、売上高が15%増加しました。',
331
+ 'この成功は、新製品ラインの発売と、新興市場へのサービスの拡大が大きく貢献しています。',
332
+ 'この成長を踏まえ、今後の数ヶ月にわたって、いくつかの戦略的イニシアティブを実施する予定です。',
333
+ '1', 'R&D部門の拡大:市場での競争力を維持するために、大幅に研究開発に投資する予定です。',
334
+ '2', 'サステナビリティの取り組み:次の5年間で、炭素排出量を30%削減することを目指しています。',
335
+ 'これは、再生可能エネルギー源への移行と、すべての事業活動における環境にやさしい実践の導入を含むものです。',
336
+ '3', 'デジタルトランスフォーメーション: 私たちのITインフラを強化し、効率を向上させ、より良いサービスを提供する',
337
+ 'さらに、今年は新型コロナウイルス感染症の懸念が続くため、オンラインで開催されますが、毎年恒例の年次カンファレンスをお知らせいたします。',
338
+ 'カンファレンスは2024年11月15日~16日に開催され、業界のリーダーによるキーノートスピーチ、インタラクティブワークショップ、ネットワークングの機会が盛りだくさんです。',
339
+ '引き続きご支援とご協力を賜りますようお願い申し上げます。',
340
+ 'これらのイニシアチブについてご質問がある場合や、さらに詳しい情報をご希望の場合は、ご担当マネジャーにご連絡するか、弊社のカスタマーサポートチームにご連絡ください。',
341
+ '弊社の信頼を賜り、誠にありがとうございます。',
342
+ '共に新たな目標を達成できることを楽しみにしています。',
343
+ 'ご清栄のこととお慶び申し上げます。',
344
+ 'ジョン・スミス', 'XYZ株式会社のCEO']
345
  ```
346
 
347
+ ### ベンチマーク結果 Benchmark results
348
 
349
+ 集計中です
350
+ Currently being compiled
351
 
352
+ ### 謝辞 Acknowledgements
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
 
354
+ - **Developed by:** [dahara1@webbigdata]
355
+ - **Language(s) (NLP):** [English, Japanese]
356
+ - **base model [optional]:** [gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it)
357
 
358
  **BibTeX:**
359
+ ```
360
+ @misc{dahara2024imatrix,
361
+ author = {dahara1@webbigdata},
362
+ title = {gemma-2-2b-jpn-it-translate: A translation task-specific model based on gemma-2-2b-jpn-it},
363
+ year = {2024},
364
+ howpublished = {\url{https://huggingface.co/webbigdata/gemma-2-2b-jpn-it-translate/}},
365
+ note = {Accessed: 2024-10-10},
366
+ abstract = {This model is an improvement over the 2B model, which is specialized for Japanese.},
367
+ }
368
+ ```
369