houminmin commited on
Commit
4b2df98
·
verified ·
1 Parent(s): 2c36f62

update readme

Browse files
Files changed (1) hide show
  1. README.md +41 -142
README.md CHANGED
@@ -2,154 +2,53 @@
2
  license: apache-2.0
3
  ---
4
 
5
- # Model Card for Model ID
 
6
 
7
- <!-- Provide a quick summary of what the model is/does. -->
 
8
 
9
- This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
10
 
11
- ## Model Details
 
 
12
 
13
- ### Model Description
14
-
15
- <!-- Provide a longer summary of what this model is. -->
16
- This is a logistic regression model that is intended to use with an embedding model to classify if a piece of text contains business sensitive information (1 means yes, 0 means no).
17
- Please refer to the Training details section below to learn how the model was trained.
18
-
19
-
20
-
21
- - **Developed by:** [More Information Needed]
22
- - **Funded by [optional]:** [More Information Needed]
23
- - **Shared by [optional]:** [More Information Needed]
24
- - **Model type:** [More Information Needed]
25
- - **Language(s) (NLP):** [More Information Needed]
26
- - **License:** [More Information Needed]
27
- - **Finetuned from model [optional]:** [More Information Needed]
28
-
29
- ### Model Sources [optional]
30
-
31
- <!-- Provide the basic links for the model. -->
32
-
33
- - **Repository:** [More Information Needed]
34
- - **Paper [optional]:** [More Information Needed]
35
- - **Demo [optional]:** [More Information Needed]
36
-
37
- ## Uses
38
-
39
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
40
- This model is intended to be used in the BusinessSafetyClassifier of the OPEA Guardrail. TODO--> ADD LINK
41
-
42
-
43
- ## Bias, Risks, and Limitations
44
-
45
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
46
- This model is trained and tested with a public dataset (Patronus EnterprisePII). It may not have good accuracy on other datasets. Users of this model should test the performance of this model on their own datasets.
47
-
48
-
49
- ## How to Get Started with the Model
50
-
51
- Refer to the instructions in OPEA Gaurdrail. --> TODO: add link.
52
 
53
  ## Training Details
54
- 1. Dataset: Patronus EnterprisePII dataset, preprocessed to get the text and golden labels.
55
- 2. Embedding model: nomic-ai/nomic-embed-text-v1
56
- 3. Training process: split the dataset into train/test sets (test is about 10% of the total data). Embed the text with the embedding model. Feed the embeddings into logistic regresstion classifier. Use the golden labels in the dataset to train the classifier.
57
-
58
-
59
- TODO: link to training recipe???
60
-
61
- ### Training Data
62
-
63
- <!-- 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. -->
64
-
65
- [More Information Needed]
66
-
67
- ### Training Procedure
68
-
69
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
70
-
71
- #### Preprocessing [optional]
72
-
73
- [More Information Needed]
74
-
75
-
76
- #### Training Hyperparameters
77
-
78
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
79
 
80
 
81
  ## Evaluation
82
-
83
- <!-- This section describes the evaluation protocols and provides the results. -->
84
-
85
- ### Testing Data, Factors & Metrics
86
-
87
- #### Testing Data
88
-
89
- <!-- This should link to a Dataset Card if possible. -->
90
-
91
- [More Information Needed]
92
-
93
- #### Factors
94
-
95
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
96
-
97
- [More Information Needed]
98
-
99
- #### Metrics
100
-
101
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
102
-
103
- [More Information Needed]
104
-
105
- ### Results
106
-
107
- [More Information Needed]
108
-
109
- #### Summary
110
-
111
-
112
-
113
- ## Model Examination [optional]
114
-
115
- <!-- Relevant interpretability work for the model goes here -->
116
-
117
- [More Information Needed]
118
-
119
- ## Environmental Impact
120
-
121
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
122
-
123
- 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).
124
-
125
- - **Hardware Type:** [More Information Needed]
126
- - **Hours used:** [More Information Needed]
127
- - **Cloud Provider:** [More Information Needed]
128
- - **Compute Region:** [More Information Needed]
129
- - **Carbon Emitted:** [More Information Needed]
130
-
131
- ## Technical Specifications [optional]
132
-
133
- ### Model Architecture and Objective
134
-
135
- [More Information Needed]
136
-
137
- ### Compute Infrastructure
138
-
139
- [More Information Needed]
140
-
141
- #### Hardware
142
-
143
- [More Information Needed]
144
-
145
- #### Software
146
-
147
- [More Information Needed]
148
-
149
- ## Model Card Authors [optional]
150
-
151
- [More Information Needed]
152
-
153
- ## Model Card Contact
154
-
155
- [More Information Needed]
 
2
  license: apache-2.0
3
  ---
4
 
5
+ # Business Safety Classifier - for demo purpose only
6
+ Please read carefully the [disclaimers](#important-notices-and-disclaimers) below before downloading and using this model!
7
 
8
+ ## Model Description
9
+ This is a logistic regression model that was developed by Intel to demonstrate possibility of training such a light-weight model to classify if a piece of text contains business sensitive information or not. You can refer to the [OPEA guardrail microservice webpage](https://github.com/opea-project/GenAIComps/tree/main/comps/guardrails/pii_detection) to learn more about the demo deployment of such a model in a guardrail microservice as part of a GenAI application.
10
 
 
11
 
12
+ - **Developed by:** Intel
13
+ - **Model type:** logistic regression classifier in pickled format
14
+ - **License:** [To be discussed with BU Legal]
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  ## Training Details
18
+ 1. Dataset: [Patronus EnterprisePII dataset](https://www.patronus.ai/announcements/patronus-ai-launches-enterprisepii-the-industrys-first-llm-dataset-for-detecting-business-sensitive-information),
19
+ 2. Dataset preprocessing: get the text and golden labels from the orginal dataset.
20
+ 3. Embedding model: [nomic-ai/nomic-embed-text-v1](https://huggingface.co/nomic-ai/nomic-embed-text-v1). The embedding model was used as-is without any fine-tuning.
21
+ 4. Annotation LLM: [mistralai/Mixtral-8x7B-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1). The LLM was used as-is without any fine tuning.
22
+ 5. Dataset annotation: used Annotation LLM to generate labels for the samples in the dataset. The label is 1 if LLM denotes that the text contains business sensitive info, else label is 0.
23
+ 6. The LLM annotation accuracy with respect to the golden labels is shown in the Evaluation section below. The reason for LLM annotation is that we want to demo the feasibility of using LLMs to generate high-quality labels in potentail use cases where there is no labeled text for training. **Note**: the LLM annotations have not been validated by human experts, instead we compared the LLM-annotated labels with the golden labels provided by the original dataset and observed good precision/recall.
24
+ 7. Training process: 1) split the dataset into train/test sets (test is about 10% of the total data). 2) Embed the training data with the embedding model. 3) Feed the embeddings into the logistic regresstion (LR) classifier. Use the LLM-annotated labels in the dataset to train the LR classifier from scratch.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
 
27
  ## Evaluation
28
+ ### LLM annotation accuracy (entire dataset)
29
+ The LLM annotation accuracy was evaluated on the entire Patronus EnterprisePII dataset. We calculated annotation accuracy with respect to the golden labels in the dataset. Below are the metrics that we collected when we conducted the annotation runs.
30
+
31
+ | Metric | Value |
32
+ |-----------|-------|
33
+ | Accuracy | 0.909 |
34
+ | Precision | 0.883 |
35
+ | Recall | 0.940 |
36
+
37
+ ### LR classifier accuracy (test split)
38
+ We evaluated the LR classifier accuracy on our test split of the Patronus EnterprisePII dataset, which has no overlap with the training split. The metrics on the test set are shown below. Interestingly, although the classifier was trained with LLM-annotated labels, the classifier performed perfectly on the 300 test samples when using the golden labels in the original dataset as the reference, while it achieves slighlty lower but still very good accuracy (around 0.9) when using the LLM annotations (which the classifier was trained on) as reference. This shows that the LR classifier did not overfit to the LLM-annotated labels.
39
+
40
+ | |Accuracy|Precision|Recall|
41
+ |--|-------|---------|------|
42
+ |Compared to golden labels|1.0|1.0|1.0|
43
+ |Compared to LLM annotated labels|0.903|0.927|0.886|
44
+
45
+ ## Important Notices and Disclaimers
46
+ 1. The accuracy, precision, and recall metrics obtained for this reference implementation should not be seen as a goal or threshold for applied implementations, or as a judgement for what adequate performance ought to be. Each applied implementation ought to determine its own performance thresholds prior to deployment.
47
+ 2. The types of sensitive information contained the Patronus EnterprisePII dataset are not exhaustive and may not container certain types of sensitive information that are important for your applications. Therefore, the LR classifier trained with Patronus EnterprisePII dataset may not give satisfactory detection accuracy/precision/recall for your applications.
48
+ 3. The model does not support any language other than English.
49
+ 4. This model is served as a demo model for further testing and developing classifiers to detect the presence of business sensitive information, including personally identifying information (PII).
50
+ 5. This model is intended to allow users to examine and evaluate the model and the associated Intel Confidential performance of Intel technology solutions. The accuracy of computer models is a function of the relation between the data used to train them and the data that the models encounter after eployment. This model has been tested using datasets that may or may not be sufficient for use in production applications. Accordingly, while the model may serve as a strong foundation, Intel recommends and requests that this model be tested against data.
51
+ the model is likely to encounter in specific deployments.
52
+ 6. There is no publicly available fairness metrics for the models and datasets that served as inputs for this model. Further testing is needed to demonstrate whether there are disparities in whether PII is equally successfully identified across different demographic groups.
53
+ 7. This model should not be used without further testing, or without human oversight and review of the outputs to ensure PII and other sensitive items are fully removed. This model should not be used in situations where the consequences of inaccuracy are high. It is not appropriate to use this model as part of any investigation of employee conduct.
54
+ 8. Human Rights Disclaimer: Intel is committed to respecting human rights and avoiding causing or directly contributing to adverse impacts on human rights. See Intel’s [Global Human Rights Policy](https://www.intel.com/content/www/us/en/policy/policy-human-rights.html). The [software or model] licensed from Intel is intended for socially responsible applications and should not be used to cause or contribute to a violation of internationally recognized human rights.