weitechen / anafora

Anafora is a web-based raw text annotation tool
241 stars 54 forks source link

Installation guide #40

Open savkov opened 7 years ago

savkov commented 7 years ago

Hey everyone,

Anafora looks like a really powerful tool, but so far I haven't been able to set it up successfully. Is there any installation guide other that this one? Also, is the project still alive?

scottsask commented 7 years ago

This does look like the best tool for what on the surface appears to be a simple task: arbitrarily annotate some text data with a web application.

Other tools out there in this space that, as the documentation suggests, expect arcane formats, are heavy desktop applications, and basically from a different era of computing.

The project seems alive (there was a commit 22 days ago). I'm going to try to get it running here as I have a mechanical turk task in mind that this would work great for. If I have any luck, I will let you know -- there's this guide here as well which is where I will be starting:

https://github.com/weitechen/anafora/wiki/Install-Guide

S

scottsask commented 7 years ago

Hey,

I just managed to get it installed...it was a bit of a pain, the config supplied was for an older version of Django than I installed I believe was part of the issue. It was quite a few hoops to jump through, but I did manage to get it running. Just trying to figure out how to configure schemas and get that all rolling now. It's definitely more documentation than I have the time to write at this moment, but you can do it if you watch the error log and turn on django debugging.

S

nawshad commented 7 years ago

Hi @scottsask, I followed this article to install anafora in ubuntu. Although I was able to install it (resolving some issues of old django config), I have broken page showing up whenever I try to access anafora in my localhost. I am attaching the picture: de2e42813a026c5f7ca7156595bd35dd50373b101943fdf12f7427528cc75ac4

I am not sure, why is this happening, can you please help? Also, can you share your steps of installation, this will help me double checking if I am doing anything wrong.

Thanks a lot!

scottsask commented 7 years ago

Heya nawshad,

I’m on vacation without a laptop here, but I recall getting to a similar spot you are in. When you open the console/developer tools in the browser what errors are you seeing in there ? It should give you some clues.

nawshad commented 7 years ago

Hi scott, In the console, It shows ReferenceError: OnLoad is not defined. Also a bunch of get errors with js files not found. Seems like js files are broken and some other missing, seems strange. I guess it may be permission issue of those js folders, do you think the same? BTW, thanks for reply though. Nawshad

nawshad commented 7 years ago

Finally I was able to make it run. I used the sample project file provided in github, but now I am kind of stuck in this page: image I dont know how to locate the corpus.

scottsask commented 7 years ago

Nice looks good. The corpus is the files that you want to annotate. I believe there is an example or some documentation on this. Each text file you want to annotate needs to be placed in its own folder in a certain directory in the anafora folder, if I recall correctly. I had well over 1000 text files to annotate so I wrote a little python script to place each text file in a folder of the same name (I believe this is required). I could tell you for certain by looking when I can access a computer. Hope that helps!

rashed0120 commented 6 years ago

Hi:

I got a following error when i run the Apache Server:

apache2: Syntax error on line 141 of /etc/apache2/apache2.conf: Syntax error on line 21 of /etc/apache2/mods-enabled/alias.conf: without matching section Action 'configtest' failed. Here is my alias file:


<IfModule alias_module>
Alias /anafora/static /home/subjectglance/anafora-1.0.0/src/main/static

    <Directory "/usr/share/apache2/icons">
            Options FollowSymlinks
            AllowOverride None
            Require all granted
    </Directory>


Any suggestion how can i run the Apache server?
dkincaid commented 6 years ago

"Require all granted" only works in Apache version 2.4 and above. What version of Apache are you using?

rashed0120 commented 6 years ago

@dkincaid It is APache 2.4.

rashed0120 commented 6 years ago

@dkincaid Any thoughts, i configured anafora based on your wiki. Please let me know how i can run Anafora .

dkincaid commented 6 years ago

Well it seems to be calling out line 21 of your /etc/apache2/mods-enabled/alias.conf file. Can you paste the full contents of that file here?

rashed0120 commented 6 years ago

@dkincaid Here is the full alias.conf file:

<IfModule alias_module>
    # Aliases: Add here as many aliases as you need (with no limit). The format is
    # Alias fakename realname
    #
    # Note that if you include a trailing / on fakename then the server will
    # require it to be present in the URL.  So "/icons" isn't aliased in this
    # example, only "/icons/".  If the fakename is slash-terminated, then the
    # realname must also be slash terminated, and if the fakename omits the
    # trailing slash, the realname must also omit it.
    #
    # We include the /icons/ alias for FancyIndexed directory listings.  If
    # you do not use FancyIndexing, you may comment this out.

    Alias /anafora/static /home/subjectglance/anafora-1.0.0/src/main/static

               <Directory "/usr/share/apache2/icons">
                Options FollowSymlinks
                AllowOverride None
                Require all granted
        </Directory>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
dkincaid commented 6 years ago

It has been a while since I worked with Apache. Try removing the "Directory" section and see if it works.

So delete out: <Directory "/usr/share/apache2/icons"> Options FollowSymlinks AllowOverride None Require all granted

You can also try adding:

Alias /icons/ "/usr/share/apache2/icons"

weitechen commented 6 years ago

Hello,

The project is still alive. However, since I'm not an expert of Django / HTTP Server, sometimes I don't really know the answer for some installation question. The most easy way is to try and error. I also plan to re-factor Anafora, and make it more installation friendly, and fit the current Web development fusion. You can contact me if you need more help.

BTW, thanks for the users who help me to answer these questions. I'm so happy to know that so many people are using Anafora!

weitechen commented 6 years ago

@rashed0120 @dkincaid Here are the settings in my Apache server configuration:

Alias /anafora/static /pathToAnafora/src/static

<Directory "/pathToAnafora/src/static/"> Require all granted

adeshtk commented 6 years ago

Hi @weitechen What version of Django are you using on your current setup, please?

So, I have tried following the installation instruction provided here: http://dkincaid.github.io/nlp/2014/07/09/installing-anafora.html but I can into some issues with Django version (sorry I didn't note what the exact errors were but there was a number).

I found references online to indicate that the reason I was having those errors was that I was using a more recent version of Django than the code supported. I reinstalled with version 1.4.22 of Django but now I am having a Key_error, for a missing key "REMOTE_USER" in file /var/www/anafora/src/main/annotate/views.py, line 68.

Kindly advise. Been trying to sort this out for several days.

adeshtk commented 6 years ago

Hi @weitechen

I am still trying to achieve an install. I am posting my most recent error log entry here. Perhaps someone has an idea what might be going on.

[Fri Jun 22 18:08:55.755597 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] mod_wsgi (pid=13829): Exception occurred processing WSGI script '/var/www/anafora/src/web/wsgi.py'. [Fri Jun 22 18:08:55.755703 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] Traceback (most recent call last): [Fri Jun 22 18:08:55.755827 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] File "/var/www/anafora/src/web/wsgi.py", line 23, in [Fri Jun 22 18:08:55.755955 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] application = get_wsgi_application() [Fri Jun 22 18:08:55.755975 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] File "/usr/lib/python2.7/dist-packages/django/core/wsgi.py", line 14, in get_wsgi_application [Fri Jun 22 18:08:55.756024 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] django.setup() [Fri Jun 22 18:08:55.756037 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] File "/usr/lib/python2.7/dist-packages/django/init.py", line 18, in setup [Fri Jun 22 18:08:55.756093 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] apps.populate(settings.INSTALLED_APPS) [Fri Jun 22 18:08:55.756109 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate [Fri Jun 22 18:08:55.756233 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] app_config = AppConfig.create(entry) [Fri Jun 22 18:08:55.756243 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] File "/usr/lib/python2.7/dist-packages/django/apps/config.py", line 86, in create [Fri Jun 22 18:08:55.756315 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] module = import_module(entry) [Fri Jun 22 18:08:55.756325 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module [Fri Jun 22 18:08:55.756362 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] import(name) [Fri Jun 22 18:08:55.756386 2018] [wsgi:error] [pid 13829:tid 140583191652096] [client ::1:35788] ImportError: No module named annotate

Cheers.

weitechen commented 6 years ago

Hello @adeshtk

  1. The version of Django running on my machine is 1.11.8 and 1.11.10 . Both of them work well. I believe Anafora can run on any Django under ver. 1.11.X .

  2. In the recent updates of Anafora (27e2abfa71143ce1d445608d139e720d8ef561c1), we change the default name of the application from annotate to anafora. So you can edit the settings.py file. At Line 146, please change annotate to anafora, restart the HTTP server, and see how Anafora works. Please let me know these steps help or not.

I'll change the default application name in the sample settings.py.template file in the next updates.

adeshtk commented 6 years ago

Thanks @weitechen That did help. I am dealing with something a bit different. I can't see select documents in the file selection window. First, none of the documents get listed. Using the sample documents and schema provided with Anafora, I get the error shown here:

screenshot

What do you suggest? Ah, I should add, I have applied the recommended directory permissions as shown on page 12, section 9.2 of the Anafora documentation.

weitechen commented 6 years ago

@adeshtk

  1. Can you start a basic annotation work (rather than an adjudication task)? To do this under the Sample Project, you need to first remove one of the two sample annotation files doc22.Medicine.stylerw.completed.xml or doc22.Medicine.weitechen.completed.xml. Then you should be able to add a basic annotation under doc22 task.

  2. If you can start and save a basic annotation task, the permission issue likely comes from the permission setting of administration. The settings depend on your authentication methods: i. LDAP: You should add your Linux user account to the "anaforaadmin" group ii. Apache Digest: You should create a group file, put the following contents to the file anaforaadmin: ACCOUNT_NAME ACCOUNT_NAME is your login account. And put the path of this group file in the Line 186 of settings.py file

adeshtk commented 6 years ago

Hi @weitechen Thanks for your help. It's helping me move things along. Got it to work in annotation mode. However, in the adjudication mode, I am having a bit of a challenge. The Schema pane, Annotation detail pane and relationship grid are either empty or not displayed at all. An error is also displayed in the developer console as shown in the first screenshot below.

screenshot2

adeshtk commented 6 years ago

Hi @weitechen I am happy to inform you that I had resolved the last reported issue. Apparently, some files were hidden in the project folder and the permission changes were not being applied to them (I am not used to Linux/Ubuntu, but a windows user).

So, it would seem I have properly setup the app now (I hope). However, I still have one big challenge. I can't use the Adjudication feature. When I use this feature (with two completed annotation files), the completed annotations don't show up in the file selection window. On the other hand, the completed annotations show up when I select the View option in the Administrator section of the file selection window.

For annotator accounts, nothing shows up in the "In-progress" and "Completed" columns. Currently, the only way to return to an in-progress task is to ensure you know the name of the file so you can open it.

I am not sure what the View option under the Administrator section is supposed to do. But what it actually does is that it displays only the last selected annotation in the annotation pane (though it allows me to select two annotations, only the last selected one is displayed).

The "Enable" option under Cross Document displays a blank annotation pane but the annotation schema pane is correctly populated.

Finally, when I disable Debug in settings.py, the file selection window no longer displays! The developer console contains an error 400 message but no error logged in Apache's error log file.

yijun-li-20 commented 6 years ago

I have followed the given guide in the issue and I find it hard to run the django backend service now. In other words, I would like to know which py file to run? Could you tell me ? I'm using Anafora-1.0.0 with the guide written by @dkincaid . I have successfully set up the port and apache server. Thank you!

tyuanhang commented 6 years ago

Hi @nawshad ,

I have come across the same question. The process of loading static files fails. Could you please give me some advice on this problem?

Thanks for your reply.

nipunsadvilkar commented 6 years ago

Facing the same issue of not able to load static files.

[23/Nov/2018 14:05:05] "GET / HTTP/1.1" 200 7912
[23/Nov/2018 14:05:05] "GET /static/css/themes/default/style.css HTTP/1.1" 404 1798
[23/Nov/2018 14:05:05] "GET /static/css/style.css HTTP/1.1" 404 1753
[23/Nov/2018 14:05:05] "GET /static/js/lib/jquery.min.js HTTP/1.1" 404 1774
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.jstree.js HTTP/1.1" 404 1783
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.jstree.schema.js HTTP/1.1" 404 1804
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.hotkeys.js HTTP/1.1" 404 1786
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.ui.position.min.js HTTP/1.1" 404 1810
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.contextMenu.min.js HTTP/1.1" 404 1810
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.json-2.4.min.js HTTP/1.1" 404 1801
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.cookie.js HTTP/1.1" 404 1783
[23/Nov/2018 14:05:06] "GET /static/js/anafora/errorHandler.js HTTP/1.1" 404 1792
[23/Nov/2018 14:05:06] "GET /static/js/anafora/schema.js HTTP/1.1" 404 1774
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaProject.js HTTP/1.1" 404 1798
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaObj.js HTTP/1.1" 404 1786
[23/Nov/2018 14:05:06] "GET /static/js/anafora/propertyFrame.js HTTP/1.1" 404 1795
[23/Nov/2018 14:05:06] "GET /static/js/anafora/annotate.js HTTP/1.1" 404 1780
[23/Nov/2018 14:05:06] "GET /static/js/anafora/annotateFrame.js HTTP/1.1" 404 1795
[23/Nov/2018 14:05:06] "GET /static/js/anafora/aObjSelectionMenu.js HTTP/1.1" 404 1807
[23/Nov/2018 14:05:06] "GET /static/js/anafora/projectSelector.js HTTP/1.1" 404 1801
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaAdjudicationProject.js HTTP/1.1" 404 1834
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaCrossAdjudicationProject.js HTTP/1.1" 404 1849
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaCrossProject.js HTTP/1.1" 404 1813
[23/Nov/2018 14:05:06] "GET /static/js/anafora/eventLogging.js HTTP/1.1" 404 1792
[23/Nov/2018 14:05:06] "GET /static/js/anafora/stablePair.js HTTP/1.1" 404 1786
[23/Nov/2018 14:05:06] "GET /static/js/anafora/relationFrame.js HTTP/1.1" 404 1795
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.min.js HTTP/1.1" 404 1774
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.jstree.js HTTP/1.1" 404 1783
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.jstree.schema.js HTTP/1.1" 404 1804
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.hotkeys.js HTTP/1.1" 404 1786
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.ui.position.min.js HTTP/1.1" 404 1810
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.contextMenu.min.js HTTP/1.1" 404 1810
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.json-2.4.min.js HTTP/1.1" 404 1801
[23/Nov/2018 14:05:06] "GET /static/js/lib/jquery.cookie.js HTTP/1.1" 404 1783
[23/Nov/2018 14:05:06] "GET /static/js/anafora/errorHandler.js HTTP/1.1" 404 1792
[23/Nov/2018 14:05:06] "GET /static/js/anafora/schema.js HTTP/1.1" 404 1774
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaProject.js HTTP/1.1" 404 1798
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaObj.js HTTP/1.1" 404 1786
[23/Nov/2018 14:05:06] "GET /static/js/anafora/annotate.js HTTP/1.1" 404 1780
[23/Nov/2018 14:05:06] "GET /static/js/anafora/propertyFrame.js HTTP/1.1" 404 1795
[23/Nov/2018 14:05:06] "GET /static/js/anafora/annotateFrame.js HTTP/1.1" 404 1795
[23/Nov/2018 14:05:06] "GET /static/js/anafora/aObjSelectionMenu.js HTTP/1.1" 404 1807
[23/Nov/2018 14:05:06] "GET /static/js/anafora/projectSelector.js HTTP/1.1" 404 1801
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaAdjudicationProject.js HTTP/1.1" 404 1834
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaCrossProject.js HTTP/1.1" 404 1813
[23/Nov/2018 14:05:06] "GET /static/js/anafora/anaforaCrossAdjudicationProject.js HTTP/1.1" 404 1849
[23/Nov/2018 14:05:06] "GET /static/js/anafora/relationFrame.js HTTP/1.1" 404 1795
[23/Nov/2018 14:05:06] "GET /static/js/anafora/stablePair.js HTTP/1.1" 404 1786
[23/Nov/2018 14:05:06] "GET /static/js/anafora/eventLogging.js HTTP/1.1" 404 1792
[23/Nov/2018 14:05:07] "GET /static/image/anaforafavicon.png HTTP/1.1" 404 1786

I'm using Django 1.9 version. Anyone able to resolve it?

arunzz commented 5 years ago

Dont bother about relative static_url working in django. Just make sure your assets are available in apache path and change base.html to update your references. Remove {{static_root}} with updated path.