🚀 kasrahabib/KM35NCDF
このモデルは、ソフトウェア要件データセット(SWARD)上で sentence-transformers/all-MiniLM-L6-v2 をファインチューニングしたもので、19種類の非機能要件を分類するために使用されます。文献によると、19種類のクラスのうち、2種類のクラス(DataとBehavior)は機能的ソフトウェア要件のタイプに属します。評価セットでは以下の結果を達成しています。
- 訓練損失: 0.1691
- 検証損失: 0.7548
- エポック数: 14
- 最終マクロF1スコア: 0.79
ラベル:
0 または A -> 可用性;
1 または AC -> アクセス制御;
2 または AU -> 監査;
3 または B -> 振る舞い;
4 または D -> データ;
5 または FT -> 耐障害性;
6 または I -> インターフェース/相互運用性;
7 または LE -> 法的;
8 または LF -> 外観と感触;
9 または MN -> 保守性;
10 または O -> 運用性;
11 または PE -> パフォーマンス;
12 または PO -> 移植性;
13 または RL -> 信頼性;
14 または SA -> 安全性;
15 または SC -> 拡張性;
16 または SE -> セキュリティ;
17 または ST -> 安定性;
18 または US -> 使いやすさ;
🚀 クイックスタート
💻 使用例
基本的な使用法
from transformers import pipeline
frame_work = 'tf'
task = 'text-classification'
model_ckpt = 'kasrahabib/KM35NCDF '
software_requirment_cls = pipeline(task = task, model = model_ckpt, framework = frame_work)
example_1_US = 'Application needs to keep track of subtasks in a task.'
example_2_PE = 'The system shall allow users to enter time in several different formats.'
example_3_AC = 'The system shall allow users who hold any of the ORES/ORELSE/PROVIDER keys to be viewed as a clinical user and has full access privileges to all problem list options.'
software_requirment_cls([example_1_US, example_2_PE, example_3_AC])
[{'label': 'US', 'score': 0.9712953567504883},
{'label': 'PE', 'score': 0.9457865953445435},
{'label': 'AC', 'score': 0.9639136791229248}]
高度な使用法
import numpy as np
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
model_ckpt = 'kasrahabib/KM35NCDF '
tokenizer = AutoTokenizer.from_pretrained(model_ckpt)
model = TFAutoModelForSequenceClassification.from_pretrained(model_ckpt)
example_1_US = 'Application needs to keep track of subtasks in a task.'
example_2_PE = 'The system shall allow users to enter time in several different formats.'
example_3_AC = 'The system shall allow users who hold any of the ORES/ORELSE/PROVIDER keys to be viewed as a clinical user and has full access privileges to all problem list options.'
requirements = [example_1_US, example_2_PE, example_3_AC]
encoded_requirements = tokenizer(requirements, return_tensors = 'np', padding = 'longest')
y_pred = model(encoded_requirements).logits
classifications = np.argmax(y_pred, axis = 1)
classifications = [model.config.id2label[output] for output in classifications]
print(classifications)
['US', 'PE', 'AC']
📦 インストール
ローカルダウンロード時の使用方法 (例: GitHub)
- リポジトリをクローンします。
git lfs install
git clone url_of_repo
- ダウンロードしたディレクトリのパスを特定します。
model_ckpt
変数にパスのリンクを記述します。
その後、以下のようにコードを修正します。
import numpy as np
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
model_ckpt = 'rest_of_the_path/KM35NCDF '
tokenizer = AutoTokenizer.from_pretrained(model_ckpt)
model = TFAutoModelForSequenceClassification.from_pretrained(model_ckpt)
example_1_US = 'Application needs to keep track of subtasks in a task.'
example_2_PE = 'The system shall allow users to enter time in several different formats.'
example_3_AC = 'The system shall allow users who hold any of the ORES/ORELSE/PROVIDER keys to be viewed as a clinical user and has full access privileges to all problem list options.'
requirements = [example_1_US, example_2_PE, example_3_AC]
encoded_requirements = tokenizer(requirements, return_tensors = 'np', padding = 'longest')
y_pred = model(encoded_requirements).logits
classifications = np.argmax(y_pred, axis = 1)
classifications = [model.config.id2label[output] for output in classifications]
print(classifications)
📚 ドキュメント
訓練ハイパーパラメータ
訓練中に使用されたハイパーパラメータは以下の通りです。
- オプティマイザ: {'name': 'Adam', 'weight_decay': None, 'clipnorm': None, 'global_clipnorm': None, 'clipvalue': None, 'use_ema': False, 'ema_momentum': 0.99, 'ema_overwrite_frequency': None, 'jit_compile': True, 'is_legacy_optimizer': False, 'learning_rate': {'class_name': 'PolynomialDecay', 'config': {'initial_learning_rate': 2e-05, 'decay_steps': 6735, 'end_learning_rate': 0.0, 'power': 1.0, 'cycle': False, 'name': None}}, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-08, 'amsgrad': False}
- 訓練精度: float32
フレームワークのバージョン
- Transformers 4.26.1
- TensorFlow 2.11.0
- Datasets 2.10.0
- Tokenizers 0.13.2
📄 ライセンス
このモデルは Apache-2.0 ライセンスの下で提供されています。