Update Readme.

This commit is contained in:
Stephan Porada 2019-06-26 17:20:44 +02:00
parent da71594aa9
commit 0c1dc03af5
6 changed files with 57 additions and 9 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
__pycache __pycache
.DS_Store .DS_Store
*_initial.py *_initial.py
**/migrations/*_*.py
.idea .idea

View File

@ -42,7 +42,7 @@ The actual data can be found here: https://gitlab.ub.uni-bielefeld.de/sporada/bu
12. Shutdown the app with the command `docker-compose down`. 12. Shutdown the app with the command `docker-compose down`.
13. Change the owner rights of all files in the repository. (This step should only be necessary for linux systems.) 13. Change the owner rights of all files in the repository. (This step should only be necessary for linux systems.)
- This has to be done because every process inside a docker container is always executed with root privilage. Thus the created volumes are not accessable anymore. - This has to be done because every process inside a docker container is always executed with root privilage. Thus the created volumes are not accessable anymore.
- Change the rights with `sudo chown -R $USER:$USER`. - Change the rights with `sudo chown -R $USER:$USER .`.
12. Download the folders *MdB\_data* and *outputs* from the link mentioned in [this repository](https://gitlab.ub.uni-bielefeld.de/sporada/bundesdata_markup_nlp_data). 12. Download the folders *MdB\_data* and *outputs* from the link mentioned in [this repository](https://gitlab.ub.uni-bielefeld.de/sporada/bundesdata_markup_nlp_data).
- Copy those into the folder *input_volume* which is located inside the web app repository on the root level. - Copy those into the folder *input_volume* which is located inside the web app repository on the root level.
- If the downloaded folders are inside an archive extract the folders first. - If the downloaded folders are inside an archive extract the folders first.

View File

@ -103,6 +103,9 @@ class Command(BaseCommand):
# self.stdout.write("\tSpeech ID is:" + str(speech.speech_id)) # self.stdout.write("\tSpeech ID is:" + str(speech.speech_id))
# self.stdout.write("\tPrevious Speech ID is:" + str(speech.previous_speech_id)) # self.stdout.write("\tPrevious Speech ID is:" + str(speech.previous_speech_id))
# self.stdout.write("\tNext Speech ID is:" + str(speech.next_speech_id)) # self.stdout.write("\tNext Speech ID is:" + str(speech.next_speech_id))
speaker_party_then = current_e.xpath(".//damalige_fraktion")[0]
speech.speaker_party_then = speaker_party_then.text
print(speech.speaker_party_then)
speaker_type = current_e.xpath("//@typ")[0] speaker_type = current_e.xpath("//@typ")[0]
speech.speaker_type = speaker_type speech.speaker_type = speaker_type
speaker_id = current_e.xpath(".//redner/@id")[0] speaker_id = current_e.xpath(".//redner/@id")[0]

View File

@ -38,6 +38,7 @@ class Speech(models.Model):
null=True, blank=True, verbose_name="MdB ID", ) null=True, blank=True, verbose_name="MdB ID", )
speech_content = models.TextField(verbose_name="Redeinhalt") # import as XML element to string speech_content = models.TextField(verbose_name="Redeinhalt") # import as XML element to string
original_string = models.TextField(verbose_name="Original String") original_string = models.TextField(verbose_name="Original String")
speaker_party_then = models.CharField(verbose_name="Damalige Partei", max_length=255, null=True, blank=True, default= None)
def __str__(self): def __str__(self):
return (str(self.foreign_protocol) + " " + str(self.speech_id) + " " return (str(self.foreign_protocol) + " " + str(self.speech_id) + " "

View File

@ -69,7 +69,8 @@
{% if speaker.name_prefix %} {% if speaker.name_prefix %}
{{speaker.name_prefix}} {{speaker.name_prefix}}
{% endif %} {% endif %}
{{speaker.last_name}}:</a></h5> {{speaker.last_name}}
({{speaker.party}}):</a></h5>
{% else %} {% else %}
<span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können beim zugehörigen Redeeintrag unter dem Punkt Original String gefunden werden."><i <span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können beim zugehörigen Redeeintrag unter dem Punkt Original String gefunden werden."><i
class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span> class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span>

View File

@ -14,7 +14,7 @@
<p class="center-align"><i class="large material-icons blue-grey-text darken-4">insert_comment</i></p> <p class="center-align"><i class="large material-icons blue-grey-text darken-4">insert_comment</i></p>
<span class="card-title">Metadaten</span> <span class="card-title">Metadaten</span>
<ul> <ul>
<li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">insert_drive_file</i><a href="/protokolle/protokoll/{{current_speech.foreign_protocol.protocol_id}}">Aus Protokoll: <li><a href="/protokolle/protokoll/{{current_speech.foreign_protocol.protocol_id}}"><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">insert_drive_file</i>Aus Protokoll:
{{current_speech.foreign_protocol.protocol_id}}</a></li> {{current_speech.foreign_protocol.protocol_id}}</a></li>
<br /> <br />
<li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">date_range</i>Datum: {{current_speech.foreign_protocol.session_date}}</li> <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">date_range</i>Datum: {{current_speech.foreign_protocol.session_date}}</li>
@ -64,7 +64,7 @@
<li> <li>
<div class="collapsible-header"><i class="large material-icons blue-grey-text darken-4">insert_comment</i>Vorherige Rede als Kontext</div> <div class="collapsible-header"><i class="large material-icons blue-grey-text darken-4">insert_comment</i>Vorherige Rede als Kontext</div>
<div class="collapsible-body"> <div class="collapsible-body">
<h6>{% if previous_speech.foreign_speaker.id %} <h5>{% if previous_speech.foreign_speaker.id %}
Rede von {% if previous_speech.foreign_speaker.title %} Rede von {% if previous_speech.foreign_speaker.title %}
{{previous_speech.foreign_speaker.title}} {{previous_speech.foreign_speaker.title}}
{% endif %} {% endif %}
@ -76,12 +76,24 @@
{{previous_speech.foreign_speaker.name_prefix}} {{previous_speech.foreign_speaker.name_prefix}}
{% endif %} {% endif %}
{{previous_speech.foreign_speaker.last_name}} {{previous_speech.foreign_speaker.last_name}}
({{previous_speech.foreign_speaker.party}})
{% else %} {% else %}
<span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können beim zugehörigen Redeeintrag unter dem Punkt Original String gefunden werden."><i <span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können beim zugehörigen Redeeintrag unter dem Punkt Original String gefunden werden."><i
class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span> class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span>
{% endif %} {% endif %}
</h6> </h5>
<hr class="blue-grey-text darken-4" />
<br />
<ul class="blue-grey-text darken-4">
{% if previous_speech.speaker_party_then == None %}
<li>Parteizugehörigkeit zum Zeitpunkt der Rede:
({{previous_speech.foreign_speaker.party}})</li>
{% else %}
<li>Parteizugehörigkeit zum Zeitpunkt der Rede:
({{previous_speech.speaker_party_then}})</li>
{% endif %}
<li>Letzte offizielle eingetragene Parteizugehörigkeit: ({{previous_speech.foreign_speaker.party}})</li>
</ul>
<br />
<span>{% autoescape off %}{{previous_speech_html}}{% endautoescape %}</span> <span>{% autoescape off %}{{previous_speech_html}}{% endautoescape %}</span>
</div> </div>
</li> </li>
@ -105,10 +117,22 @@
{{current_speech.foreign_speaker.name_prefix}} {{current_speech.foreign_speaker.name_prefix}}
{% endif %} {% endif %}
{{current_speech.foreign_speaker.last_name}} {{current_speech.foreign_speaker.last_name}}
({{current_speech.foreign_speaker.party}})</span> </span>
<hr class="blue-grey-text darken-4" />
<ul class="blue-grey-text darken-4">
{% if current_speech.speaker_party_then == None %}
<li>Parteizugehörigkeit zum Zeitpunkt der Rede:
({{current_speech.foreign_speaker.party}})</li>
{% else %}
<li>Parteizugehörigkeit zum Zeitpunkt der Rede:
({{current_speech.speaker_party_then}})</li>
{% endif %}
<li>Letzte offizielle eingetragene Parteizugehörigkeit: ({{current_speech.foreign_speaker.party}})</li>
</ul>
{% else %} {% else %}
<span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können links unter 'Original String' gelesen werden."><i <span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können links unter 'Original String' gelesen werden."><i
class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span> class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span>
<hr class="blue-grey-text darken-4" />
{% endif %} {% endif %}
{% autoescape off %} {% autoescape off %}
{{current_speech_html}} {{current_speech_html}}
@ -123,7 +147,8 @@
<li> <li>
<div class="collapsible-header"><i class="large material-icons blue-grey-text darken-4">insert_comment</i>Nächste Rede als Kontext</div> <div class="collapsible-header"><i class="large material-icons blue-grey-text darken-4">insert_comment</i>Nächste Rede als Kontext</div>
<div class="collapsible-body"> <div class="collapsible-body">
<h6>Rede von {% if next_speech.foreign_speaker.title %} <h5>{% if next_speech.foreign_speaker.id %}
Rede von {% if next_speech.foreign_speaker.title %}
{{next_speech.foreign_speaker.title}} {{next_speech.foreign_speaker.title}}
{% endif %} {% endif %}
{% if next_speech.foreign_speaker.nobility %} {% if next_speech.foreign_speaker.nobility %}
@ -134,7 +159,24 @@
{{next_speech.foreign_speaker.name_prefix}} {{next_speech.foreign_speaker.name_prefix}}
{% endif %} {% endif %}
{{next_speech.foreign_speaker.last_name}} {{next_speech.foreign_speaker.last_name}}
({{next_speech.foreign_speaker.party}})</h6> {% else %}
<span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können beim zugehörigen Redeeintrag unter dem Punkt Original String gefunden werden."><i
class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span>
{% endif %}
</h5>
<hr class="blue-grey-text darken-4" />
<br />
<ul class="blue-grey-text darken-4">
{% if previous_speech.speaker_party_then == None %}
<li>Parteizugehörigkeit zum Zeitpunkt der Rede:
({{next_speech.foreign_speaker.party}})</li>
{% else %}
<li>Parteizugehörigkeit zum Zeitpunkt der Rede:
({{next_speech.speaker_party_then}})</li>
{% endif %}
<li>Letzte offizielle eingetragene Parteizugehörigkeit: ({{next_speech.foreign_speaker.party}})</li>
</ul>
<br />
<span><span>{% autoescape off %}{{next_speech_html}}{% endautoescape %}</span> <span><span>{% autoescape off %}{{next_speech_html}}{% endautoescape %}</span>
</div> </div>
</li> </li>