kasrahabib / KM45L6V2OC

huggingface.co
Total runs: 22
24-hour runs: 0
7-day runs: 4
30-day runs: 21
Model's Last Updated: August 07 2023
text-classification

Introduction of KM45L6V2OC

Model Details of KM45L6V2OC

kasrahabib/KM45L6V2OC

This model is a fine-tuned version of sentence-transformers/all-MiniLM-L6-v2 , for classifying softwrae requirments into functional (F) and Non-functional (NF) types, on Software Requirements Dataset (SWARD). It achieves the following results on the evaluation set:

  • Train Loss: 0.0107
  • Validation Loss: 0.0404
  • Epoch: 14
  • Final Macro F1-score: 0.99

Labels : 0 or F -> Functional; 1 or NF -> Non-functional;

Usage Pipeline
from transformers import pipeline

frame_work = 'tf'
task = 'text-classification'
model_ckpt = 'kasrahabib/KM45L6V2OC'

software_requirment_cls = pipeline(task = task, model = model_ckpt, framework = frame_work)

example_1_f = 'The START NEW PROJECT function shall allow the user to create a new project.'
example_2_nf = 'The email string consists of [email protected] and is less than 31 characters in length and is not empty.'
software_requirment_cls([example_1_f, example_2_nf])
[{'label': 'F', 'score': 0.9998922348022461},
 {'label': 'NF', 'score': 0.999846339225769}]
Model Inference:

import numpy as np
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification

model_ckpt = 'kasrahabib/KM45L6V2OC'
tokenizer = AutoTokenizer.from_pretrained(model_ckpt)
model = TFAutoModelForSequenceClassification.from_pretrained(model_ckpt)

example_1_f = 'The START NEW PROJECT function shall allow the user to create a new project.'
example_2_nf = 'The email string consists of [email protected] and is less than 31 characters in length and is not empty.'
requirements = [example_1_f, example_2_nf]

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)
['F', 'NF']
Usage Locally Downloaded (e.g., GitHub):

1 - Clone the repository:

git lfs install
git clone url_of_repo

2 - Locate the path to the downloaded directory
3 - Write the link to the path in the model_ckpt variable

Then modify the code as below:

import numpy as np
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification

model_ckpt = 'rest_of_the_path/KM45L6V2OC'
tokenizer = AutoTokenizer.from_pretrained(model_ckpt)
model = TFAutoModelForSequenceClassification.from_pretrained(model_ckpt)

example_1_f = 'The START NEW PROJECT function shall allow the user to create a new project.'
example_2_nf = 'The email string consists of [email protected] and is less than 31 characters in length and is not empty.'
requirements = [example_1_f, example_2_nf]

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)
[{'label': 'F', 'score': 0.9998922348022461},
 {'label': 'NF', 'score': 0.999846339225769}]
Training hyperparameters

The following hyperparameters were used during training:

  • optimizer: {'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': 9030, '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}
  • training_precision: float32
Framework versions
  • Transformers 4.26.1
  • TensorFlow 2.11.0
  • Datasets 2.10.1
  • Tokenizers 0.13.2

Runs of kasrahabib KM45L6V2OC on huggingface.co

22
Total runs
0
24-hour runs
2
3-day runs
4
7-day runs
21
30-day runs

More Information About KM45L6V2OC huggingface.co Model

More KM45L6V2OC license Visit here:

https://choosealicense.com/licenses/apache-2.0

KM45L6V2OC huggingface.co

KM45L6V2OC huggingface.co is an AI model on huggingface.co that provides KM45L6V2OC's model effect (), which can be used instantly with this kasrahabib KM45L6V2OC model. huggingface.co supports a free trial of the KM45L6V2OC model, and also provides paid use of the KM45L6V2OC. Support call KM45L6V2OC model through api, including Node.js, Python, http.

kasrahabib KM45L6V2OC online free

KM45L6V2OC huggingface.co is an online trial and call api platform, which integrates KM45L6V2OC's modeling effects, including api services, and provides a free online trial of KM45L6V2OC, you can try KM45L6V2OC online for free by clicking the link below.

kasrahabib KM45L6V2OC online free url in huggingface.co:

https://huggingface.co/kasrahabib/KM45L6V2OC

KM45L6V2OC install

KM45L6V2OC is an open source model from GitHub that offers a free installation service, and any user can find KM45L6V2OC on GitHub to install. At the same time, huggingface.co provides the effect of KM45L6V2OC install, users can directly use KM45L6V2OC installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

KM45L6V2OC install url in huggingface.co:

https://huggingface.co/kasrahabib/KM45L6V2OC

Url of KM45L6V2OC

Provider of KM45L6V2OC huggingface.co

kasrahabib
ORGANIZATIONS

Other API from kasrahabib

huggingface.co

Total runs: 14
Run Growth: 14
Growth Rate: 100.00%
Updated:August 07 2023