You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
2.1 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. from django.urls import path
  2. from rest_framework import routers
  3. from .views import IndexView
  4. from .views import ProjectView, DatasetView, DataUpload, LabelView, StatsView, GuidelineView
  5. from .views import ProjectsView, DataDownload
  6. from .views import DemoTextClassification, DemoNamedEntityRecognition, DemoTranslation
  7. from .api import ProjectViewSet, LabelList, ProjectStatsAPI, LabelDetail, \
  8. AnnotationList, AnnotationDetail, DocumentList
  9. router = routers.DefaultRouter()
  10. router.register(r'projects', ProjectViewSet)
  11. urlpatterns = [
  12. path('', IndexView.as_view(), name='index'),
  13. path('api/projects/<int:project_id>/stats/', ProjectStatsAPI.as_view(), name='stats-api'),
  14. path('api/projects/<int:project_id>/labels/', LabelList.as_view(), name='labels'),
  15. path('api/projects/<int:project_id>/labels/<int:label_id>', LabelDetail.as_view(), name='label'),
  16. path('api/projects/<int:project_id>/docs/', DocumentList.as_view(), name='docs'),
  17. path('api/projects/<int:project_id>/docs/<int:doc_id>/annotations/', AnnotationList.as_view(), name='annotations'),
  18. path('api/projects/<int:project_id>/docs/<int:doc_id>/annotations/<int:annotation_id>', AnnotationDetail.as_view(), name='ann'),
  19. path('projects/', ProjectsView.as_view(), name='projects'),
  20. path('projects/<int:project_id>/download', DataDownload.as_view(), name='download'),
  21. path('projects/<int:project_id>/', ProjectView.as_view(), name='annotation'),
  22. path('projects/<int:project_id>/docs/', DatasetView.as_view(), name='dataset'),
  23. path('projects/<int:project_id>/docs/create', DataUpload.as_view(), name='upload'),
  24. path('projects/<int:project_id>/labels/', LabelView.as_view(), name='label-management'),
  25. path('projects/<int:project_id>/stats/', StatsView.as_view(), name='stats'),
  26. path('projects/<int:project_id>/guideline/', GuidelineView.as_view(), name='guideline'),
  27. path('demo/text-classification/', DemoTextClassification.as_view(), name='demo-text-classification'),
  28. path('demo/named-entity-recognition/', DemoNamedEntityRecognition.as_view(), name='demo-named-entity-recognition'),
  29. path('demo/translation/', DemoTranslation.as_view(), name='demo-translation'),
  30. ]