Commit 69d6d2aa authored by Jayasith H.B.C's avatar Jayasith H.B.C

Merge branch 'master' into 'IT19079264'

Master

See merge request !74
parents 5affaf06 f690acbf
from config.database import db
class Attribute(db.Model):
id = db.Column(db.Integer, primary_key=True)
data_type = db.Column(db.String(50), nullable=False)
name = db.Column(db.String(50), nullable=False)
access_spec = db.Column(db.String(50), nullable=False)
class_id = db.Column(db.Integer)
def __repr__(self) -> str:
return 'Attribute>>> {self.content}'
from sqlalchemy.orm import relationship
from config.database import db
class Component(db.Model):
id = db.Column(db.Integer, primary_key=True)
class_answer = db.Column(db.Integer, nullable=False)
name = db.Column(db.String(50), nullable=False)
type = db.Column(db.String(50), nullable=False)
def __repr__(self) -> str:
return 'Class>>> {self.content}'
from config.database import db
class Method(db.Model):
id = db.Column(db.Integer, primary_key=True)
return_type = db.Column(db.String(50))
name = db.Column(db.String(50), nullable=False)
access_spec = db.Column(db.String(50))
class_id = db.Column(db.Integer)
def __repr__(self) -> str:
return 'Method>>> {self.content}'
[paths]
train = "./training_data.spacy"
dev = "./training_data.spacy"
vectors = null
init_tok2vec = null
[system]
gpu_allocator = null
seed = 0
[nlp]
lang = "en"
pipeline = ["tok2vec","ner"]
batch_size = 1000
disabled = []
before_creation = null
after_creation = null
after_pipeline_creation = null
tokenizer = {"@tokenizers":"spacy.Tokenizer.v1"}
[components]
[components.ner]
factory = "ner"
incorrect_spans_key = null
moves = null
scorer = {"@scorers":"spacy.ner_scorer.v1"}
update_with_oracle_cut_size = 100
[components.ner.model]
@architectures = "spacy.TransitionBasedParser.v2"
state_type = "ner"
extra_state_tokens = false
hidden_width = 64
maxout_pieces = 2
use_upper = true
nO = null
[components.ner.model.tok2vec]
@architectures = "spacy.Tok2VecListener.v1"
width = ${components.tok2vec.model.encode.width}
upstream = "*"
[components.tok2vec]
factory = "tok2vec"
[components.tok2vec.model]
@architectures = "spacy.Tok2Vec.v2"
[components.tok2vec.model.embed]
@architectures = "spacy.MultiHashEmbed.v2"
width = ${components.tok2vec.model.encode.width}
attrs = ["NORM","PREFIX","SUFFIX","SHAPE"]
rows = [5000,2500,2500,2500]
include_static_vectors = false
[components.tok2vec.model.encode]
@architectures = "spacy.MaxoutWindowEncoder.v2"
width = 96
depth = 4
window_size = 1
maxout_pieces = 3
[corpora]
[corpora.dev]
@readers = "spacy.Corpus.v1"
path = ${paths.dev}
max_length = 0
gold_preproc = false
limit = 0
augmenter = null
[corpora.train]
@readers = "spacy.Corpus.v1"
path = ${paths.train}
max_length = 0
gold_preproc = false
limit = 0
augmenter = null
[training]
dev_corpus = "corpora.dev"
train_corpus = "corpora.train"
seed = ${system.seed}
gpu_allocator = ${system.gpu_allocator}
dropout = 0.1
accumulate_gradient = 1
patience = 1600
max_epochs = 0
max_steps = 20000
eval_frequency = 200
frozen_components = []
annotating_components = []
before_to_disk = null
[training.batcher]
@batchers = "spacy.batch_by_words.v1"
discard_oversize = false
tolerance = 0.2
get_length = null
[training.batcher.size]
@schedules = "compounding.v1"
start = 100
stop = 1000
compound = 1.001
t = 0.0
[training.logger]
@loggers = "spacy.ConsoleLogger.v1"
progress_bar = false
[training.optimizer]
@optimizers = "Adam.v1"
beta1 = 0.9
beta2 = 0.999
L2_is_weight_decay = true
L2 = 0.01
grad_clip = 1.0
use_averages = false
eps = 0.00000001
learn_rate = 0.001
[training.score_weights]
ents_f = 1.0
ents_p = 0.0
ents_r = 0.0
ents_per_type = null
[pretraining]
[initialize]
vectors = ${paths.vectors}
init_tok2vec = ${paths.init_tok2vec}
vocab_data = null
lookups = null
before_init = null
after_init = null
[initialize.components]
[initialize.tokenizer]
\ No newline at end of file
{
"lang":"en",
"name":"pipeline",
"version":"0.0.0",
"spacy_version":">=3.4.1,<3.5.0",
"description":"",
"author":"",
"email":"",
"url":"",
"license":"",
"spacy_git_version":"Unknown",
"vectors":{
"width":0,
"vectors":0,
"keys":0,
"name":null,
"mode":"default"
},
"labels":{
"tok2vec":[
],
"ner":[
"ACCESS_SP",
"ATTRIBUTE_NAME",
"DATA_TYPE",
"METHOD_NAME",
"MULTIPLICITY",
"PARAMETERS"
]
},
"pipeline":[
"tok2vec",
"ner"
],
"components":[
"tok2vec",
"ner"
],
"disabled":[
],
"performance":{
"ents_f":0.9938850387,
"ents_p":0.9918633035,
"ents_r":0.9959150327,
"ents_per_type":{
"ACCESS_SP":{
"p":0.995157385,
"r":0.9927536232,
"f":0.9939540508
},
"ATTRIBUTE_NAME":{
"p":0.9959183673,
"r":0.9959183673,
"f":0.9959183673
},
"DATA_TYPE":{
"p":0.9856321839,
"r":1.0,
"f":0.99276411
},
"METHOD_NAME":{
"p":0.993902439,
"r":0.993902439,
"f":0.993902439
},
"MULTIPLICITY":{
"p":0.9756097561,
"r":1.0,
"f":0.987654321
},
"PARAMETERS":{
"p":1.0,
"r":1.0,
"f":1.0
}
},
"tok2vec_loss":78.7692795898,
"ner_loss":1014.2115147574
}
}
\ No newline at end of file
{
"moves":null,
"update_with_oracle_cut_size":100,
"multitasks":[
],
"min_action_freq":1,
"learn_tokens":false,
"beam_width":1,
"beam_density":0.0,
"beam_update_prob":0.0,
"incorrect_spans_key":null
}
\ No newline at end of file
moves{"0":{},"1":{"ACCESS_SP":414,"DATA_TYPE":346,"ATTRIBUTE_NAME":256,"METHOD_NAME":166,"MULTIPLICITY":102,"PARAMETERS":26},"2":{"ACCESS_SP":414,"DATA_TYPE":346,"ATTRIBUTE_NAME":256,"METHOD_NAME":166,"MULTIPLICITY":102,"PARAMETERS":26},"3":{"ACCESS_SP":414,"DATA_TYPE":346,"ATTRIBUTE_NAME":256,"METHOD_NAME":166,"MULTIPLICITY":102,"PARAMETERS":26},"4":{"ACCESS_SP":414,"DATA_TYPE":346,"ATTRIBUTE_NAME":256,"METHOD_NAME":166,"MULTIPLICITY":102,"PARAMETERS":26,"":1},"5":{"":1}}cfgneg_key
\ No newline at end of file
{
}
\ No newline at end of file
This diff is collapsed.
\ No newline at end of file
This diff is collapsed.
{
"mode":"default"
}
\ No newline at end of file
......@@ -4,6 +4,9 @@ from flask import request, jsonify, Blueprint
from flask_jwt_extended import jwt_required, get_jwt_identity
from constants.http_status_codes_constant import HTTP_400_BAD_REQUEST, HTTP_200_OK
from services.class_model_detection_service import component_separation
from models.actor_and_use_case import ActorANDUseCase
from services.submission_service import save_submission
from services.use_case_model_detection_service import model_object_detection
......@@ -27,9 +30,10 @@ def upload_submission():
use_case_obj = save_submission(assignment_id, image, submission_type, comment, user_id)
model_object_detection(image.filename, use_case_obj.id)
return jsonify({'message': 'upload successful '}), HTTP_200_OK
elif submission_type == 'class':
class_obj = save_submission(assignment_id, image, submission_type, comment, user_id)
# model_object_detection(image.filename, class_obj.id)
component_separation(image.filename, class_obj.id)
return jsonify({'id': str(class_obj.id)}), HTTP_200_OK
else:
return jsonify({'err': 'invalid request '}), HTTP_400_BAD_REQUEST
item {
id: 1
name: 'class'
name: 'association'
}
item {
id: 2
name: 'relationship'
name: 'class'
}
item {
id: 3
name: 'composition'
}
item {
id: 4
name: 'indirect association'
}
item {
id: 5
name: 'inheritance'
}
item {
id: 6
name: 'interface'
}
item {
id: 7
name: 'realization'
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment