From 2627123e76ea0f7dfa36c419b362fa85977654e7 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 16 Jul 2024 15:09:55 -0400 Subject: [PATCH 1/7] Change DOM editing to jQuery and add Dockerfile --- Dockerfile | 36 +++++++++++++++++++ annotate.db | Bin 0 -> 12288 bytes newsentsExample.csv.rankings.json | 56 ++++++++++++++++++++++++++++++ requirements.txt | 5 +-- settings.cfg | 2 +- templates/annotate.html | 55 +++++++++++++++-------------- templates/edittree.html | 31 ++++++++++------- templates/layout.html | 2 ++ 8 files changed, 145 insertions(+), 42 deletions(-) create mode 100644 Dockerfile create mode 100644 annotate.db create mode 100644 newsentsExample.csv.rankings.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e0597b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM python:3.6 + +RUN echo export PATH=$HOME/.local/bin:$PATH >> ~/.bashrc + +COPY requirements.txt requirements.txt + + +RUN apt-get update +RUN apt-get install -y git +RUN apt-get install -y make +RUN apt-get install -y texlive-latex-base +RUN apt-get install -y texlive-fonts-recommended +#RUN apt-get install -y texlive-fonts-extra +RUN git clone --recursive https://github.com/andreasvc/disco-dop.git +RUN cd disco-dop + + +RUN pip install --user --no-cache-dir -r requirements.txt + +WORKDIR /disco-dop/ +RUN pip install sphinx +RUN mkdir -p _static +RUN make install +RUN pip install grapheme + +WORKDIR /home/merug/activedopmeru/ +ENV FLASK_APP=app.py +ENV FLASK_RUN_HOST=0.0.0.0 +ENV FLASK_ENV=development +#RUN python -m flask initdb +#RUN python -m flask initpriorities +COPY . . + +EXPOSE 5000 + +CMD ["python", "-m", "flask", "run", "--with-threads"] \ No newline at end of file diff --git a/annotate.db b/annotate.db new file mode 100644 index 0000000000000000000000000000000000000000..298943261d1290d823ac3f5ebe60231c137ad7d8 GIT binary patch literal 12288 zcmeI#F;4<96bJAg8Z{&r*cezkLV_m7FCZEg!lIHmUJCcbhPxj29tq4QemB37gM%#| zgQ0}QiTs=NdhN@*w!hxer-zYdk}rkL70VmZ6j3B@r4&L$uAaEMExv!c?YP$W50yw< zJrCo?m#D?xBK~fC9!fwQ0uX=z1Rwwb2tWV=5P$##{$JpI7@fD;?dW69YLXEdwwlVS zsog&g`s0Bd_wPmnSq;igT}quwrWH$5xVp@;o*VO7rjXh&&B*=Rj2ioYPu%ez|*cYul}NFKcJ5emfG{q_isEGIy&_)RK!$KdH_y zxvpOPz5c@gQL%qC{R0I85P$##AOHafKmY;|fB*y_0D)r_sQZoK{(r2;i+w==0uX=z S1Rwwb2tWV=5P$##HUd9Y9k}EG literal 0 HcmV?d00001 diff --git a/newsentsExample.csv.rankings.json b/newsentsExample.csv.rankings.json new file mode 100644 index 0000000..79d725e --- /dev/null +++ b/newsentsExample.csv.rankings.json @@ -0,0 +1,56 @@ +[ + [ + 3, + 3.6736298275241372, + "The girl ate pizza with tomatoes", + "id4" + ], + [ + 1, + 2.702709644336757, + "The girl ate the pizza with a fork", + "id2" + ], + [ + 2, + 2.5013714625137196, + "The girl ate the pizza with the tomatoes", + "id3" + ], + [ + 0, + 1.6475508327726855, + "The boy saw the girl under the tree with the telescope in the forest", + "id1" + ], + [ + 7, + 0.8895849807473573, + "The mouse saw the little cat", + "id8" + ], + [ + 4, + -0.0, + "The cat saw the pizza", + "id5" + ], + [ + 5, + -0.0, + "The mouse stole the pizza", + "id6" + ], + [ + 6, + -0.0, + "The cat ate the mouse", + "id7" + ], + [ + 8, + -0.0, + "The cat ate the dog", + "id9" + ] +] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e091441..27bbe9a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ -Flask==2.1.0 +Flask==2.0.2 numpy scikit-learn pylatexenc -Werkzeug==2.2.2 +Werkzeug==2.0.2 +Cython==0.29.37 diff --git a/settings.cfg b/settings.cfg index cca85fd..6839608 100644 --- a/settings.cfg +++ b/settings.cfg @@ -1,7 +1,7 @@ SECRET_KEY=b';boc.xbanuh;qdaoeiq' DEBUG = False GRAMMAR = 'cgelbank2/' -SENTENCES = 'ewt-manual.cgelpos' +SENTENCES = 'newsentsExample.csv' LIMIT = 70 ANNOTATIONHELP = None ACCOUNTS = { diff --git a/templates/annotate.html b/templates/annotate.html index 8c3ca49..e3c155d 100644 --- a/templates/annotate.html +++ b/templates/annotate.html @@ -40,47 +40,48 @@ - +{%block script %} - +{% endblock %} diff --git a/templates/edittree.html b/templates/edittree.html index 3bb655e..d744984 100644 --- a/templates/edittree.html +++ b/templates/edittree.html @@ -32,34 +32,41 @@ {{ msg }} +{%block script %} + + +{% endblock %} +