-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/l9t2-fastapi
- Loading branch information
Showing
11 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/config.local | ||
/tmp | ||
/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[core] | ||
remote = minio | ||
['remote "minio"'] | ||
url = s3://ml-data | ||
endpointurl = http://10.0.0.6:9000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Add patterns of files dvc should ignore, which could improve | ||
# the performance. Learn more at | ||
# https://dvc.org/doc/user-guide/dvcignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ accelerate==0.25.0 | |
datasets==2.16.1 | ||
wandb==0.16.1 | ||
httpx==0.26.0 | ||
ipykernel==6.28.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/data.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
outs: | ||
- md5: 7ec83b215d1790bedaf458a1690370e3 | ||
size: 25144581 | ||
hash: md5 | ||
path: data.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: minio-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: minio | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
# Label is used as selector in the service. | ||
app: minio | ||
spec: | ||
volumes: | ||
- name: storage | ||
persistentVolumeClaim: | ||
claimName: minio-pv-claim | ||
containers: | ||
- name: minio | ||
image: quay.io/minio/minio:latest | ||
args: | ||
- server | ||
- /storage | ||
env: | ||
# Minio access key and secret key | ||
- name: MINIO_ACCESS_KEY | ||
value: "minio" | ||
- name: MINIO_SECRET_KEY | ||
value: "minio123" | ||
ports: | ||
- containerPort: 9003 | ||
hostPort: 9003 | ||
volumeMounts: | ||
- name: storage | ||
mountPath: "/storage" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
language: en | ||
tags: | ||
- bert | ||
license: apache-2.0 | ||
datasets: | ||
- GonzaloA/fake_news | ||
--- | ||
|
||
# BERT fake news classifiction model | ||
|
||
Pretrained model on English language based on uncased version of BERT finetuned for task of binary classification. | ||
|
||
|
||
### How to use | ||
|
||
You can use this model directly with a pipeline for masked language modeling: | ||
|
||
```python | ||
|
||
tokenizer = BertTokenizer.from_pretrained(PATH, local_files_only=True) | ||
bert_model = BertForSequenceClassification.from_pretrained(PATH, local_files_only=True) | ||
|
||
# run infernce | ||
|
||
``` | ||
With transformers pipeline | ||
|
||
```python | ||
|
||
text_classification_pipeline = pipeline( | ||
"text-classification", | ||
model=PATH, | ||
tokenizer=PATH, | ||
return_all_scores=True | ||
) | ||
``` | ||
|
||
|
||
## Training data | ||
|
||
The BERT model was pretrained on [bert-base-uncased](https://huggingface.co/bert-base-uncased), a dataset consisting of ~25,000 of news labeled as fake and real. | ||
For training purpoose 10k of samples randomly selected and splitted in 80:20 ratio. | ||
|
||
## Training procedure | ||
|
||
### Preprocessing | ||
|
||
The texts are tokenized using BERT tokenizer. | ||
|
||
### Training | ||
|
||
The model was trained on GPU T4 x 2. | ||
|
||
## Evaluation results | ||
|
||
|
||
| Epoch | Training Loss | Validation Loss | Accuracy | | ||
|-------|---------------|-----------------|----------| | ||
| 1 | 0.074000 | 0.027787 | 0.986500 | | ||
| 2 | 0.032600 | 0.010920 | 0.995000 | | ||
| 3 | 0.010100 | 0.002739 | 0.999500 | | ||
|