Page MenuHomec4science

home.html
No OneTemporary

File Metadata

Created
Wed, May 14, 21:36

home.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Pacifico">
<link rel="icon" href="http://obj-cache.cloud.ruanbekker.com/favicon.ico">
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<title>InfoExtractor</title>
</head>
<body>
<div class="container">
<h1>Extract information from your ID card</h1>
<form action = "/id" method = "post">
<div>
<h2>Select from which Country a ID card is generated</h2>
</div>
<button class="btn" type="submit" formaction="/ch">
Switzerland
</button>
<button class="btn" type="submit" formaction="/de">
Germany
</button>
<button class="btn" type="submit" formaction="/fr">
France
</button>
<button class="btn" type="submit" formaction="/it">
Italy
</button>
<button class="btn" type="submit" formaction="/fi">
Finland
</button>
<h2>Your ID card</h2>
<h4>(try to add your own name, or replace a label with an equivalent word, i.e. from your mother language)</h4>
<textarea rows = "10" cols = "160" name = "my_id">
{{my_id_text[0]}}
</textarea>
<div>
<h2>
What should the model extract from your ID card?
</h2>
<h4>Click on a button below or define your custom question (use key words, not sentences)</h4>
</div>
<button class="btn btn-info" type="submit" formaction="/first_name">
First name
</button>
<button class="btn btn-info" type="submit" formaction="/last_name">
Last name
</button>
<button class="btn btn-info" type="submit" formaction="/birth_date">
Birth date
</button>
{% if opt[3] in ["CH"] %}
<button class="btn btn-info" type="submit" formaction="/place_of_origin">
Place of origin
</button>
{% endif %}
{% if opt[3] in ["FR", "DE", "IT"] %}
<button class="btn btn-info" type="submit" formaction="/place_of_birth">
Place of birth
</button>
{% endif %}
{% if opt[3] not in ["DE"] %}
<button class="btn btn-info" type="submit" formaction="/sex">
Gender
</button>
{% endif %}
{% if opt[3] in ["DE"] %}
<button class="btn btn-info" type="submit" formaction="/eye_color">
Eye color
</button>
{% endif %}
<button class="btn btn-info" type="submit" formaction="/date_of_issue">
Date of Issue
</button>
<button class="btn btn-info" type="submit" formaction="/date_of_exp">
Date of Expiry
</button>
<button class="btn btn-info" type="submit" formaction="/card_number">
Card Number
</button>
<button class="btn btn-info" type="submit" formaction="/nat">
Nationality
</button>
{% if opt[3] not in ["FI"] %}
<button class="btn btn-info" type="submit" formaction="/height">
Height
</button>
{% endif %}
<br><br>
<button class="btn btn-info" type="submit" formaction="/custom">
Custom
</button>
<input type="text" name="custom_question" placeholder="eye color" action="/custom">
</textarea><br>
<div>
<h2>The model extracts the following answer:</h2>
<h4>
Extracted Information: {{my_id_text[1]}} <br>
Queried label: {{my_id_text[2]}} <br>
Confidence score: {{my_id_text[3]}} <br><br>
</h4>
<h4 style="color:red">
{% if opt[3] in ["CH"] %}
{{"The model is trained on similar synthetic data: same labels, but different ID entries"}}
{% endif %}
{% if opt[3] not in ["CH"] and opt[0] != "zeroshot" %}
{{"The model is trained on Swiss ID cards, and has been shown afterwards 200 "+opt[3]+
" ID card examples (without providing information which label means what): new labels, but already seen in unsupervised learning"}}
{% endif %}
{% if opt[3] not in ["CH"] and opt[0] == "zeroshot" %}
{{"The model is trained on Swiss ID cards, and has not been shown any "+opt[3]+
" ID card examples: everything is new (data and labels)"}}
{% endif %}
</h4>
<h2>Select a different model</h2>
<input type="checkbox" id="zeroshot" name="zeroshot" value="zeroshot" {{'checked="checked"' if opt[0]=="zeroshot" else ""}}>
<label for="zeroshot"> Zero shot (no finetuning to the custom dataset) </label>
<br>
<input type="radio" id="gpt2" name="model" value="gpt2" {{'checked="checked"' if opt[1]=="gpt2" else ""}}>
<label for="gpt2"> GPT2 </label>
<input type="radio" id="roberta" name="model" value="roberta" {{'checked="checked"' if opt[1]=="roberta" else ""}}>
<label for="roberta"> RoBERTa </label>
<input type="radio" id="xlmr" name="model" value="xlmr" {{'checked="checked"' if opt[1]=="xlmr" else ""}}>
<label for="xlmr"> XLM-R </label>
<br>
<button class="btn" type="submit" formaction="/model_settings">Update model settings</button><br>
<br>
Model name (that is loaded): {{opt[2]}} <br>
</div>
</form>
<br>
<div class="form-group">
<small id="help-text" class="form-text text-muted">Model developed for the Master thesis of Nicolà Gantenbein<br><br>
The ID cards use synthetic data generated by GPT2. Names and cities look similar as it is in the chosen country, but they might not exist in real live.
<br>
To fine tune the model (when not using zero shot model version), the model has been retrained with the models answer with a confidence score higher then 0.5.
It is unsupervised finetuning. If the model extracts a wrong solution with high confidence score, it will be anyway used for fine tuing. There is no human in the loop.
</small>
</div>
<br><br>
<footer class="footer">
<p>&copy; 2021 Nicolà Gantenbein </p>
</footer>
</div>
</div>
</body>
</html>

Event Timeline