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
from datasets import load_dataset, Dataset | |
from trl import SFTTrainer | |
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, TrainingArguments | |
from peft import LoraConfig | |
import torch, sys | |
dataset = load_dataset("celsowm/auryn", split="train" | |
#, download_mode="force_redownload" | |
) |
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
{ | |
"perguntas_respostas": [ | |
{ | |
"pergunta": "O que é uma procuradoria estadual e qual é o seu papel no sistema jurídico?", | |
"resposta": "Uma procuradoria estadual é um órgão responsável pela representação jurídica do Estado em questões legais. Seu papel inclui a defesa dos interesses e direitos do Estado nas esferas judicial e extrajudicial." | |
}, | |
{ | |
"pergunta": "Quais são as principais funções desempenhadas por uma procuradoria estadual?", | |
"resposta": "As principais funções de uma procuradoria estadual incluem a representação judicial e extrajudicial do Estado, a elaboração de pareceres jurídicos, a condução de processos administrativos e a assessoria aos órgãos públicos estaduais em questões legais." | |
}, |
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
import networkx as nx | |
import matplotlib.pyplot as plt | |
def plot_neural_network(entrada, oculta, saida): | |
G = nx.DiGraph() | |
G.add_nodes_from([f'Entrada{i+1}' for i in range(entrada)]) | |
G.add_nodes_from([f'Oculta{i+1}' for i in range(oculta)]) | |
G.add_nodes_from([f'Saida{i+1}' for i in range(saida)]) |
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
import torch | |
import torch.nn as nn | |
import pandas as pd | |
# Ler o arquivo CSV | |
df = pd.read_csv('diabetes.csv') | |
# Extrair os dados para feature_set e labels | |
feature_set = torch.tensor(df.drop('diabetico', axis=1).values, dtype=torch.float32) | |
labels = torch.tensor(df['diabetico'].values, dtype=torch.float32) |
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
import tensorflow as tf | |
import pandas as pd | |
# Ler o arquivo CSV | |
df = pd.read_csv('diabetes.csv') | |
# Extrair os dados para feature_set e labels | |
feature_set = df.drop('diabetico', axis=1).values | |
labels = df['diabetico'].values |
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
import networkx as nx | |
import matplotlib.pyplot as plt | |
def plot_neural_network(entrada, oculta, saida): | |
G = nx.DiGraph() | |
G.add_nodes_from([f'Entrada{i+1}' for i in range(entrada)]) | |
G.add_nodes_from([f'Oculta{i+1}' for i in range(oculta)]) | |
G.add_nodes_from([f'Saida{i+1}' for i in range(saida)]) |
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
fumante | obeso | pratica_exercicios | diabetico | |
---|---|---|---|---|
0 | 1 | 0 | 1 | |
0 | 0 | 1 | 0 | |
1 | 0 | 0 | 0 | |
1 | 1 | 0 | 1 | |
1 | 1 | 1 | 1 |
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
import numpy as np, sys | |
import pandas as pd | |
# Ler o arquivo CSV | |
df = pd.read_csv('diabetes.csv') | |
# Extrair os dados para feature_set e labels | |
feature_set = feature_set = df.drop('diabetico', axis=1).values | |
labels = df['diabetico'].values.reshape(-1, 1) |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"categoria":"esportes", | |
"titulo":"Veja a trajet\u00f3ria de Fernando Diniz, em busca da Libertadores com o Fluminense", | |
"texto":"Se tem um treinador que sempre foi badalado pela forma como faz seu time jogar, este cara \u00e9 Fernando Diniz. E o comandante do Fluminense tem a chance de chegar ao \u00e1pice da carreira neste s\u00e1bado (4), a partir das 17h (de Bras\u00edlia), quando decide a Copa Libertadores contra o Boca Juniors-ARG, no Maracan\u00e3. Rumo \u00e0 Gl\u00f3ria Eterna. E sua gl\u00f3ria pessoal. Considerado h\u00e1 alguns anos um dos melhores \u2013 sen\u00e3o o melhor \u2013 t\u00e9cnico do futebol brasileiro, Fernando Diniz sempre esbarra na desconfian\u00e7a que o persegue. Uma desconfian\u00e7a \u201cresultadista\u201d. Afinal, como pode um treinador t\u00e3o elogiado ter apenas um Campeonato Carioca (2023) na bagagem? T\u00edtulos de express\u00e3o e Diniz, at\u00e9 ent\u00e3o, pareciam n\u00e3o combinar. Leia mais Certo \u00e9 que a final da Copa Libertadores j\u00e1 |
NewerOlder