Skip to content

Commit

Permalink
QA bot for community issues and prs based on knowledge graph and Elas…
Browse files Browse the repository at this point in the history
…ticsearch
  • Loading branch information
Zhangzhaoxin123 committed Oct 25, 2022
1 parent cc8e709 commit c0625b4
Show file tree
Hide file tree
Showing 2,335 changed files with 106,982 additions and 748,674 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Model_train_predict/example/output/model_re.pth filter=lfs diff=lfs merge=lfs -text
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/.idea
**/__pycache__
conf/conf.yaml

Model_train_predict/example/ner/standard/checkpoints/*
Model_train_predict/example/re/standard/checkpoints/*

Model_train_predict/build/lib/deepke/name_entity_re/standard/models/__init__.py
Model_train_predict/dist
Model_train_predict/example/ner/standard/logs
Model_train_predict/example/ner/standard/wandb
Model_train_predict/example/re/standard/logs
Model_train_predict/example/re/standard/neo4j_relation.csv
Model_train_predict/src/deepke.egg-info
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.8

RUN apt-get update
RUN apt-get install vim --yes
#RUN cat /proc/version

WORKDIR /kg

COPY . .

# 安装环境
RUN pip install -r requirements.txt --no-cache-dir
RUN cd Model_train_predict && python setup.py install && python setup.py develop
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def load(self, path, device):
'''
加载指定路径的模型
'''
self.load_state_dict(torch.load(path, map_location=device))
self.torch.load(path, map_location=device)


def save(self, epoch=0, cfg=None):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def __init__(self, model_dir: str, vocab_size=None, num_labels=None, word2id=Non

self.word2id = word2id
self.id2label = id2label

self.model = torch.load('../Model_train_predict/example/ner/standard/checkpoints/model.pth')

self.model = torch.load('/kg/Model_train_predict/example/ner/standard/checkpoints/model_ner.pth')
self.device = "cuda" if torch.cuda.is_available() else "cpu"
self.model = self.model.to(self.device)
self.model.eval()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
model_name: "lstmcrf"
model_save_name: "model.pth"
model_save_name: "model_ner.pth"
model_vocab_path: "data_bilstm.pkl"
word_dim: 128
hidden_dim: 384
Expand Down
1 change: 1 addition & 0 deletions Model_train_predict/example/ner/standard/conf/predict.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
predict_model_path: 'Model_train_predict/example/output/model_ner.pth'
25 changes: 25 additions & 0 deletions Model_train_predict/example/ner/standard/conf/train.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
adam_epsilon: 1e-8
data_dir: "data/"
do_eval: True
do_train: True
eval_batch_size: 2 # 16
eval_on: "dev"
gpu_id: 0
gradient_accumulation_steps: 1
learning_rate: 1e-3

num_train_epochs: 2 # 150 # the number of training epochs
output_dir: "checkpoints"
seed: 42
train_batch_size: 2 # 128
use_gpu: True # use gpu or not
warmup_proportion: 0.1
weight_decay: 0.01

# For StepLR Optimizer
lr_step : 5
lr_gamma : 0.8
beta1: 0.9
beta2: 0.999
labels: ['TOO','LIN','SYS','NUM','COM','NOU','SUB','MET','PER']
# labels: ['YAS','TOJ', 'NGS', 'QCV', 'OKB', 'BQF', 'CAR', 'ZFM', 'EMT', 'UER', 'QEE', 'UFT', 'GJS', 'SVA', 'ANO', 'KEJ', 'ZDI', 'CAT', 'GCK', 'FQK', 'BAK', 'RET', 'QZP', 'QAQ', 'ZRE', 'TDZ', 'CVC', 'PMN']
1 change: 1 addition & 0 deletions Model_train_predict/example/ner/standard/ner_data.json

Large diffs are not rendered by default.

Loading

0 comments on commit c0625b4

Please sign in to comment.