Conjunto fb25bf8 en modelado_topicos


Ignorar:
Fecha y hora:
12/06/2015 09:47:58 (hace 9 años)
Autor:
Jorge Redondo Flames <jredondo@…>
Branches:
master, preprocesamiento, v1.0
Children:
ff807e0
Parents:
27c3620
Mensaje:

CSS separated, and added type=button to UI buttons

Ficheros:
1 añadido
4 editados

Leyenda

No modificado
Añadido
Eliminado
  • django_topic_explorer/settings.py

    r1d65e92 rfb25bf8  
    9595## TOPIC EXPLORER SETTINGS
    9696TOPIC_EXPLORER_PATH = '/home/jredondo/Proyectos/Analisis_del_Discurso/src/topic-explorer/'
    97 PATH = TOPIC_EXPLORER_PATH + 'demo-data/ap/../models/'
    98 CORPUS_FILE = TOPIC_EXPLORER_PATH + 'demo-data/ap/../models/ap-nltk-en-freq5.npz'
    99 MODEL_PATTERN = TOPIC_EXPLORER_PATH + 'demo-data/ap/../models/ap-nltk-en-freq5-LDA-K{0}-document-20.npz'
    100 #PATH = TOPIC_EXPLORER_PATH + 'demo-data/programapatrio_propuestas_descripcion/../models/'
    101 #CORPUS_FILE = TOPIC_EXPLORER_PATH + 'demo-data/programapatrio_propuestas_descripcion/../models/programapatrio_propuestas_descripcion-nltk-en-freq5.npz'
    102 #MODEL_PATTERN = TOPIC_EXPLORER_PATH + 'demo-data/programapatrio_propuestas_descripcion/../models/programapatrio_propuestas_descripcion-nltk-en-freq5-LDA-K{0}-document-20.npz'
     97MODELS_PATH = TOPIC_EXPLORER_PATH + 'demo-data/programapatrio_propuestas_descripcion/../models/'
     98CORPUS_FILE = MODELS_PATH + 'programapatrio_propuestas_descripcion-nltk-en-freq5.npz'
     99MODEL_PATTERN = TOPIC_EXPLORER_PATH + 'demo-data/ap/../models/programapatrio_propuestas_descripcion-nltk-en-freq5-LDA-K{0}-document-20.npz'
    103100CONTEXT_TYPE = 'document'
    104 #PORT = '16{0:03d}'
    105 #HOST = '0.0.0.0'
    106101TOPICS = '10, 20, 30, 40, 50, 60, 70, 80, 90, 100'
    107102CORPUS_NAME = 'Deafult'
    108103ICONS = 'link'
    109 #path = 'logs/aux/{0}.log'
    110104
    111105CORPUS_LINK = None
     
    113107DOC_TITTLE_FORMAT = None
    114108DOC_URL_FORMAT = None
    115 #TOPICS = None
    116 
    117 #DEFAULT_K = 50
    118109
    119110
  • topic_explorer/static/topic_explorer/js/icons.js

    rc617763 rfb25bf8  
    1212        .attr("xlink:href","/static/topic_explorer/img/link.png")
    1313        .attr("class", "linkIcon icon")
    14         //.on("click", function(d) { window.location.href = "/?doc=" + encodeURIComponent(d);});
    1514        .on("click", function(d) { window.location.href = "topic_explorer/doc/" + encodeURIComponent(d);});
    1615  },
  • topic_explorer/templates/index.html

    rc617763 rfb25bf8  
    1515<script src="{% static "topic_explorer/js/icons.js" %}"></script>
    1616<link rel="stylesheet" type="text/css" href="{% static "topic_explorer/bootstrap-2.3.2/css/bootstrap.min.css" %}"/>
    17 <!--<link rel="stylesheet" type="text/css" href="style.css" />-->
    18 <style>
    19 .y.axis text {
    20   visibility: hidden;
    21 }
    22 .y.axis g .icon {
    23   opacity: 0;
    24   }
    25 .y.axis g:hover .icon {
    26   opacity: 1.0;
    27   }
    28 
    29 .y.axis text, .y.axis image {
    30   cursor: pointer;
    31   }
    32 .y.axis rect:hover {
    33   stroke: #fff; 
    34   stroke-width: 0;
    35   opacity: 0 !important;
    36 }
    37 .y.axis rect:hover .icon {
    38   opacity: 1 !important;
    39 }
    40 
    41 .docLabel {
    42   }
    43 
    44 .bar {
    45     fill: steelblue;
    46 }
    47 
    48 .bar:hover {
    49     fill: brown;
    50 }
    51 
    52 .axis {
    53     font: 11px sans-serif;
    54 }
    55 
    56 .axis path,
    57 .axis line {
    58     fill: none;
    59     stroke: #000;
    60     shape-rendering: crispEdges;
    61 }
    62 .docLabel{
    63   font:11px sans-serif; 
    64   pointer-events: none;
    65 }
    66 
    67 rect {
    68   opacity: 0.6;
    69   }
    70 
    71 rect.hover {
    72   stroke: #000;
    73   stroke-width: 1;
    74   shape-rendering: crispEdges;
    75   cursor: crosshair;
    76 }
    77 
    78 rect.hover, .legend rect {
    79   opacity: 0.8;
    80 }
    81 .doc:hover rect, .doc.hover rect {
    82   opacity: 1.0;
    83   }
    84 rect:hover {
    85   opacity: 1.0 !important;
    86 }
    87 rect:hover, .legend.hover rect, .legend.selected rect {
    88   stroke: #000;
    89   stroke-width: 2;
    90   shape-rendering: crispEdges;
    91   }
    92 .selected text, .hover text {
    93   font-weight: bold;
    94 }
    95 #legend, #controls {
    96   position: absolute;
    97   overflow: visible;
    98 }
    99 .primary {
    100   text-transform: uppercase;
    101 }
    102 text.hover, .title{
    103   font-weight: bold;
    104   }
    105 /*
    106 .primary.doc:hover, .primary.doc {
    107   stroke: #000;
    108   stroke-width: 1px;
    109   stroke-opacity: 1.0;
    110   shape-rendering: crispEdges;
    111 }*/
    112 .logo-word {
    113   background-image: url('/img/inpho_logo.png');
    114   background-size: 172px 92px;
    115   width: 172px;
    116   height: 84px;
    117   padding-top: 6px;
    118   margin-top: 14px;
    119   margin-bottom: 15px;
    120   margin-left: -6px;
    121   display: inline-block;
    122   text-indent: -3000px;
    123 }
    124 h1 {
    125 text-align: center;
    126 margin-bottom: 0;
    127 font-size: 59px;
    128 line-height: 1;
    129 color: inherit;
    130 letter-spacing: -1px;
    131 
    132 }
    133 h1 a, h1 a:hover {
    134   color: #000;
    135   text-decoration: none;
    136 }
    137 
    138 .btn {
    139   vertical-align: middle;
    140   margin-top: 2px;
    141 }
    142 #twitter-widget-0 {
    143   margin-bottom: -11px;
    144 }
    145 .null, .non-null {
    146   display: none;
    147   }
    148 .formula {
    149   font-variant: small-caps;
    150   }
    151 .formula em {
    152   font-variant: normal; 
    153 }
    154 
    155 .popover-content {
    156   max-height: 250px;
    157   overflow-y: scroll;
    158 }
    159 
    160 </style>
     17<link rel="stylesheet" type="text/css" href="{% static "topic_explorer/css/topic_explorer.css" %}"/>
     18
    16119</head>
    16220
     
    17028  <div class="input-append">
    17129    <input type="hidden" name="doc" id="hidden_id">
    172     <input type="text" id="doc" class="typeahead input-xlarge" placeholder="Document" autocomplete="off">
     30    <input type="text" id="doc" class="typeahead input-xlarge" placeholder="Documento" autocomplete="off">
    17331    <button class="btn" type="button" id="randomDoc"><span class="icon-random"></span></button>
    17432  </div>
    17533  <div class="btn-group">
    176     <button type="submit" id="submit" class="btn">Visualize</button>
     34    <button type="button" id="submit" class="btn" >Visualizar</button>
    17735    <a class="btn dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
    17836    <ul class="dropdown-menu">
     
    257115  var url = "{0}//{1}:8000/topic_explorer/doc/{2}/".format(window.location.protocol, window.location.hostname, k);
    258116
    259   /*url += "?doc=" + encodeURIComponent($("#hidden_id").val() || docid) ;*/
    260117  url += encodeURIComponent($("#hidden_id").val() || docid) ;
    261118  window.location = url;
     
    312169<div id="chart"> </div>
    313170<div id="controls" style="display:none;">
    314   <strong>Display Options</strong>
    315   <label class="checkbox"><input class="sort" type="checkbox"> Alphabetical sort</label>
    316   <label class="checkbox"><input class="scale" type="checkbox"> Normalize topic bars</label>
    317   <button class="btn reset" onclick="resetTopicSort()" disabled>Reset Topic Sort</button><br>
    318   <button class="btn topdoc" style="display:none">Top Documents for [Topic]</button>
     171  <strong>Opciones</strong>
     172  <label class="checkbox"><input class="sort" type="checkbox"> Orden alfabético</label>
     173  <label class="checkbox"><input class="scale" type="checkbox"> Normalizar barras de tópicos</label>
     174  <button class="btn reset" type="button" onclick="resetTopicSort()" disabled>Restaurar orden de tópicos</button><br>
     175  <button class="btn topdoc" type='button' style="display:none">Ordenar documentos para tópico [Topic]</button>
    319176</div>
    320177
     
    437294      return false;
    438295    }
    439     $('#submit').text(d3.keys(topics).length + ' Topicos');
     296    $('#submit').text(d3.keys(topics).length + ' Tópicos');
    440297   
    441298 
     
    475332        .selectAll("text")
    476333        .attr("class", function(d) { return (d == docid && roottopic != null) ? "primary" : "" })
    477         //.on("click", function(d) { window.location.href = "/?doc=" + d;})
    478334        .on("click", function(d) { window.location.href = "topic_explorer/doc/" + d;})
    479335 
     
    768624      $('.topdoc').text('Top Documents for Topic ' + topic);
    769625      $('.topdoc').show();
    770       //$('.topdoc').click(function URL() {location.href = location.origin + '?topic=' + topic;});
    771       $('.topdoc').click(function URL() {location.href = location.origin + '/topic_explorer/topic/{{k_param}}/' + topic;});
     626      //$('.topdoc').click(function URL() {console.log("COMETNTADO"); location.href = location.origin + '?topic=' + topic;});
     627      $('.topdoc').click(function URL() {console.log("ACTIVO"); location.href = location.origin + '/topic_explorer/topic/{{k_param}}/' + topic;});
    772628      $('.topdoc').mouseenter(function() {
    773629          $('.legend rect').not('.top_' + topic).tooltip('hide');
  • topic_explorer/views.py

    rc617763 rfb25bf8  
    1515
    1616
    17 path = settings.PATH
     17#path = settings.PATH
    1818corpus_file = settings.CORPUS_FILE
    1919context_type = settings.CONTEXT_TYPE
     
    2222corpus_name = settings.CORPUS_NAME
    2323icons = settings.ICONS
    24 #path = 'logs/aux/{0}.log'
    2524
    2625corpus_link = settings.CORPUS_LINK
    27 #topic_range = settings.TOPIC_RANGE
    2826topics_range = [int(item) for item in settings.TOPICS.split(',')]
    2927doc_title_format = settings.DOC_TITTLE_FORMAT
     
    4745    return HttpResponseServerError(str(exc_value))
    4846
    49 # Create your views here.
    5047
    5148def doc_topic_csv(request, doc_id):
    52     #response.content_type = 'text/csv; charset=UTF8'
    53 
    5449    data = lda_v.doc_topics(doc_id)
    5550
     
    6257
    6358def doc_csv(request, doc_id, threshold=0.2):
    64     #response.content_type = 'text/csv; charset=UTF8'
    65 
    6659    data = lda_v.sim_doc_doc(doc_id)
    6760
     
    7770    lda_m = LCM.load(model_pattern.format(k_param))
    7871    lda_v = LDAViewer(lda_c, lda_m)
    79     #response.content_type = 'application/json; charset=UTF8'
    8072    try:
    8173        N = int(request.query.n)
     
    10698        except:
    10799            pass
    108 
    109         #response.content_type = 'application/json; charset=UTF8'
    110 
    111100        if N > 0:
    112101            data = lda_v.dist_doc_doc(doc_id)[:N]
     
    130119def topics(request):
    131120    try:
    132         #response.content_type = 'application/json; charset=UTF8'
    133         #response.set_header('Expires', _cache_date())
    134 
    135121        # populate entropy values
    136122        data = lda_v.topic_oscillations()
     
    157143
    158144def docs(request):
    159     #response.content_type = 'application/json; charset=UTF8'
    160     #response.set_header('Expires', _cache_date())
    161145    try:
    162146        docs = lda_v.corpus.view_metadata(context_type)[doc_label_name(context_type)]
Nota: Vea TracChangeset para ayuda en el uso del visor de conjuntos de cambios.