Skip to content

Commit

Permalink
v1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
shyvum committed Jan 20, 2020
1 parent 03891e9 commit 6de0a2d
Show file tree
Hide file tree
Showing 11 changed files with 806 additions and 435 deletions.
4 changes: 0 additions & 4 deletions lib/global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,3 @@ const List<Color> orangeGradient = [
Color(0xFFFF9945),
Color(0xFFFc6076),
];

trainModel(
step,
) {}
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:BHIM/screens/loginVerificationScreen.dart';
import 'package:BHIM/screens/LoginScreens/loginVerificationScreen.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

Expand Down
83 changes: 12 additions & 71 deletions lib/models/intentApiModel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,88 +9,29 @@ IntentApi intentApiFromJson(String str) => IntentApi.fromJson(json.decode(str));
String intentApiToJson(IntentApi data) => json.encode(data.toJson());

class IntentApi {
Intent intent;
List<Entity> entities;
List<Intent> intentRanking;
String text;
String amount;
double confidence;
String intent;
String name;

IntentApi({
this.amount,
this.confidence,
this.intent,
this.entities,
this.intentRanking,
this.text,
this.name,
});

factory IntentApi.fromJson(Map<String, dynamic> json) => IntentApi(
intent: Intent.fromJson(json["intent"]),
entities:
List<Entity>.from(json["entities"].map((x) => Entity.fromJson(x))),
intentRanking: List<Intent>.from(
json["intent_ranking"].map((x) => Intent.fromJson(x))),
text: json["text"],
);

Map<String, dynamic> toJson() => {
"intent": intent.toJson(),
"entities": List<dynamic>.from(entities.map((x) => x.toJson())),
"intent_ranking":
List<dynamic>.from(intentRanking.map((x) => x.toJson())),
"text": text,
};
}

class Entity {
int start;
int end;
String value;
String entity;
double confidence;
String extractor;

Entity({
this.start,
this.end,
this.value,
this.entity,
this.confidence,
this.extractor,
});

factory Entity.fromJson(Map<String, dynamic> json) => Entity(
start: json["start"],
end: json["end"],
value: json["value"],
entity: json["entity"],
amount: json["amount"],
confidence: json["confidence"].toDouble(),
extractor: json["extractor"],
);

Map<String, dynamic> toJson() => {
"start": start,
"end": end,
"value": value,
"entity": entity,
"confidence": confidence,
"extractor": extractor,
};
}

class Intent {
String name;
double confidence;

Intent({
this.name,
this.confidence,
});

factory Intent.fromJson(Map<String, dynamic> json) => Intent(
intent: json["intent"],
name: json["name"],
confidence: json["confidence"].toDouble(),
);

Map<String, dynamic> toJson() => {
"name": name,
"amount": amount,
"confidence": confidence,
"intent": intent,
"name": name,
};
}
Loading

0 comments on commit 6de0a2d

Please sign in to comment.