Skip to content

Commit 9774833

Browse files
committed
Merge branch 'develop' into feature/parse-interface-ctd
2 parents 7f40eed + 1e999be commit 9774833

106 files changed

Lines changed: 7288 additions & 1627 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 69 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,69 @@
1-
# LangPro Annotator
2-
3-
[![Actions Status](https://github.com/CentreForDigitalHumanities/langpro-annotator/workflows/Unit%20tests/badge.svg)](https://github.com/CentreForDigitalHumanities/langpro-annotator/actions)
4-
5-
An annotation tool for LangPro, a tableau-based theorem prover for natural logic and language.
6-
7-
*This repository is a work in progress, and the README is not yet complete!*
8-
9-
## Introduction
10-
11-
*In this section, provide an overview of your code and describe the project in which the code was developed. Highlight the purpose, scope, and potential uses of your code. Also, consider including links to relevant publications or resources that provide additional context.*
12-
13-
## Getting started
14-
15-
LangPro Annotator is a web application: it can be accessed using a web browser.
16-
17-
*If you are hosting LangPro Annotator anywhere, provide a URL and any additional info.*
18-
19-
You can also run LangPro Annotator locally or host it yourself. Be aware that this is a more advanced option. See [CONTRIBUTING.md](./CONTRIBUTING.md) for information about setting up a local server or configuring deployment.
20-
21-
## Usage
22-
23-
*Provide information about what LangPro Annotator can be used for. If you have written a user manual, this is the place to link it!*
24-
25-
## Development
26-
27-
To get started with developing LangPro Annotator, see [CONTRIBUTING.md](./CONTRIBUTING.md).
28-
29-
## Licence
30-
31-
This work is shared under a BSD 3-Clause licence. See [LICENSE](./LICENSE) for more information.
32-
33-
## Citation
34-
35-
To cite this repository, please use the metadata provided in [CITATION.cff](./CITATION.cff).
36-
37-
## Contact
38-
39-
LangPro Annotator is developed by [Research Software Lab, Centre for Digital Humanities, Utrecht University](https://cdh.uu.nl/about/research-software-lab/).
40-
41-
*Include contact information. You can also provide clear instructions for how users can provide feedback, contribute, or suggest improvements to your work.*
1+
# LangPro Annotator
2+
3+
[![Actions Status](https://github.com/CentreForDigitalHumanities/langpro-annotator/workflows/Unit%20tests/badge.svg)](https://github.com/CentreForDigitalHumanities/langpro-annotator/actions)
4+
5+
An annotation tool for LangPro, a tableau-based theorem prover for natural logic and language.
6+
7+
*This repository is a work in progress, and the README is not yet complete!*
8+
9+
## Introduction
10+
11+
*In this section, provide an overview of your code and describe the project in which the code was developed. Highlight the purpose, scope, and potential uses of your code. Also, consider including links to relevant publications or resources that provide additional context.*
12+
13+
## Getting started
14+
15+
LangPro Annotator is a web application: it can be accessed using a web browser.
16+
17+
*If you are hosting LangPro Annotator anywhere, provide a URL and any additional info.*
18+
19+
You can also run LangPro Annotator locally or host it yourself. Be aware that this is a more advanced option. See [CONTRIBUTING.md](./CONTRIBUTING.md) for information about setting up a local server or configuring deployment.
20+
21+
## Usage
22+
23+
*Provide information about what LangPro Annotator can be used for. If you have written a user manual, this is the place to link it!*
24+
25+
## Development
26+
27+
To get started with developing LangPro Annotator, see [CONTRIBUTING.md](./CONTRIBUTING.md).
28+
29+
## Permission overview
30+
31+
Apart from superusers/admins, the application has three user roles with different permissions. Users with the "Master Annotator" role have full permissions, including managing users and problem visibility/status. Users with the "Annotator" role can browse and annotate both gold and silver problems. Users without any assigned role are considered "Visitors" and can only browse gold problems.
32+
33+
Users can become Annotators or Master Annotators by adding them to the respective user groups in the Django admin interface.
34+
35+
The matrix below shows the permissions for each role. Not all permissions are currently implemented.
36+
37+
(Last updated: November 14th, 2025)
38+
39+
| | Visitor | Annotator | Master Annotator |
40+
| -------------------------- | ------- | --------- | ---------------- |
41+
| Browse gold problems | Yes | Yes | Yes |
42+
| Browse silver problems | No | Yes | Yes |
43+
| Edit KB items | No | Yes | Yes |
44+
| Add labels | No | Yes | Yes |
45+
| Remove own labels | No | Yes | Yes |
46+
| Remove other users' labels | No | No | Yes |
47+
| Add problems | No | No | Yes |
48+
| Copy problems | No | No | Yes |
49+
| Update user problems | No | No | Yes |
50+
| Delete problems | No | No | Yes |
51+
| Edit existing problems | No | No | Yes |
52+
| See hidden problems | No | No | Yes |
53+
| Silver/gold problems | No | No | Yes |
54+
| Hide/unhide problems | No | No | Yes |
55+
| Manage users | No | No | Yes |
56+
57+
## Licence
58+
59+
This work is shared under a BSD 3-Clause licence. See [LICENSE](./LICENSE) for more information.
60+
61+
## Citation
62+
63+
To cite this repository, please use the metadata provided in [CITATION.cff](./CITATION.cff).
64+
65+
## Contact
66+
67+
LangPro Annotator is developed by [Research Software Lab, Centre for Digital Humanities, Utrecht University](https://cdh.uu.nl/about/research-software-lab/).
68+
69+
*Include contact information. You can also provide clear instructions for how users can provide feedback, contribute, or suggest improvements to your work.*

backend/annotation/admin.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
from django.contrib import admin
22

3+
from annotation.models import Label
4+
5+
36
# Register your models here.
7+
@admin.register(Label)
8+
class LabelAdmin(admin.ModelAdmin):
9+
list_display = ("text", "description")
10+
search_fields = ("text",)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[
2+
{
3+
"model": "annotation.label",
4+
"pk": 1,
5+
"fields": {
6+
"text": "Important",
7+
"description": "This problem is particularly important."
8+
}
9+
},
10+
{
11+
"model": "annotation.label",
12+
"pk": 2,
13+
"fields": {
14+
"text": "Review needed",
15+
"description": "This problem needs to be reviewed by a master annotator."
16+
}
17+
},
18+
{
19+
"model": "annotation.label",
20+
"pk": 3,
21+
"fields": {
22+
"text": "Ambiguous",
23+
"description": "The problem statement is ambiguous and needs clarification."
24+
}
25+
},
26+
{
27+
"model": "annotation.label",
28+
"pk": 4,
29+
"fields": {
30+
"text": "Incomplete knowledge",
31+
"description": "Some knowledge base items are missing."
32+
}
33+
},
34+
{
35+
"model": "annotation.label",
36+
"pk": 5,
37+
"fields": {
38+
"text": "Spelling",
39+
"description": "The premises or hypothesis are misspelled, which may lead to wrong analyses."
40+
}
41+
},
42+
{
43+
"model": "annotation.label",
44+
"pk": 6,
45+
"fields": {
46+
"text": "Wrong entailment label",
47+
"description": "The entailment label is incorrect."
48+
}
49+
}
50+
]
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Generated by Django 4.2.27 on 2025-12-11 15:10
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
("problem", "0007_alter_problem_options"),
13+
("annotation", "0001_initial"),
14+
]
15+
16+
operations = [
17+
migrations.CreateModel(
18+
name="Label",
19+
fields=[
20+
(
21+
"id",
22+
models.BigAutoField(
23+
auto_created=True,
24+
primary_key=True,
25+
serialize=False,
26+
verbose_name="ID",
27+
),
28+
),
29+
("text", models.CharField(max_length=255)),
30+
(
31+
"description",
32+
models.TextField(
33+
help_text="A detailed description of the label, indicating when it should be used."
34+
),
35+
),
36+
],
37+
options={
38+
"ordering": ["text"],
39+
},
40+
),
41+
migrations.CreateModel(
42+
name="Labeling",
43+
fields=[
44+
(
45+
"id",
46+
models.BigAutoField(
47+
auto_created=True,
48+
primary_key=True,
49+
serialize=False,
50+
verbose_name="ID",
51+
),
52+
),
53+
("attached_at", models.DateTimeField(auto_now_add=True)),
54+
(
55+
"removed_at",
56+
models.DateTimeField(
57+
blank=True,
58+
help_text="When this label was removed from the problem.",
59+
null=True,
60+
),
61+
),
62+
(
63+
"notes",
64+
models.TextField(
65+
blank=True,
66+
help_text="Optional notes explaining why this label was added or removed.",
67+
),
68+
),
69+
(
70+
"attached_by",
71+
models.ForeignKey(
72+
on_delete=django.db.models.deletion.CASCADE,
73+
related_name="labelings_attached",
74+
to=settings.AUTH_USER_MODEL,
75+
),
76+
),
77+
(
78+
"label",
79+
models.ForeignKey(
80+
on_delete=django.db.models.deletion.CASCADE,
81+
related_name="labelings",
82+
to="annotation.label",
83+
),
84+
),
85+
(
86+
"problem",
87+
models.ForeignKey(
88+
on_delete=django.db.models.deletion.CASCADE,
89+
related_name="labelings",
90+
to="problem.problem",
91+
),
92+
),
93+
(
94+
"removed_by",
95+
models.ForeignKey(
96+
blank=True,
97+
help_text="User who removed this label.",
98+
null=True,
99+
on_delete=django.db.models.deletion.CASCADE,
100+
related_name="labelings_removed",
101+
to=settings.AUTH_USER_MODEL,
102+
),
103+
),
104+
],
105+
options={
106+
"ordering": ["-attached_at"],
107+
"permissions": [
108+
("delete_own_labeling", "Can remove own labeling from problems"),
109+
("delete_any_labeling", "Can remove any labeling from problems"),
110+
],
111+
"indexes": [
112+
models.Index(
113+
fields=["problem", "removed_at"],
114+
name="annotation__problem_e7ac7b_idx",
115+
),
116+
models.Index(
117+
fields=["label", "removed_at"],
118+
name="annotation__label_i_a229d2_idx",
119+
),
120+
],
121+
},
122+
),
123+
]

0 commit comments

Comments
 (0)