首页 \ 问答 \ 标签正在列表标签中(The label is falling down in the list tag)

标签正在列表标签中(The label is falling down in the list tag)

<li><span>Test:</span>
<asp:Label style="float:right;padding-right:5px"
           runat="server"
           ID="lblTest">
</asp:Label></li>

我有一个跨度和一个标签(我知道它也被渲染为span),不知何故静态跨度的文本很好但是标签的文本在Li元素中落下......直到底部。 我试过垂直对齐和文本对齐,顶部:0,但没有运气让它们在一条直线上


<li><span>Test:</span>
<asp:Label style="float:right;padding-right:5px"
           runat="server"
           ID="lblTest">
</asp:Label></li>

I have a span and a label(I am aware its also rendered as span), somehow the static span's text is fine but the label's text falls down in the Li element....down to the bottom. I have tried vertical align and text align, top:0, but no luck to have them in a straight line


原文:https://stackoverflow.com/questions/21459342
更新时间:2023-06-03 07:06

最满意答案

我有几点建议:

  • 如果你使用NGrams考虑更细粒度的标记化器。 这里的目标是纠正错误拼写:

    RegexTokenizer regexTokenizer = new RegexTokenizer()
       .setInputCol("text")
       .setOutputCol("words")
       .setPattern("");
    
    NGram ngramTransformer = new NGram()
      .setN(3)
      .setInputCol("words")
      .setOutputCol("ngrams");
    

    使用您当前的代码( NGram(3)和句子三个单词由\W分割)三,您将只获得一个标记,没有相似性。

  • 增加LSH的哈希表数( setNumHashTables )。 除了简单的例子,默认值(1)对于任何东西都是小的。

  • 规范化Unicode字符串。 有一个Scala Transformer 在PySpark中用apache spark数据帧删除重音的最佳方法是什么?

  • 删除大写。 您可以使用SQLTransformer

    import org.apache.spark.ml.feature.SQLTransformer
    
    val sqlTrans = new SQLTransformer().setStatement(
       "SELECT *, lower(normalized_text) FROM __THIS__")
    

I have a few suggestions:

  • If you use NGrams consider more granular tokenizer. The goal here is to correct for misspellings:

    RegexTokenizer regexTokenizer = new RegexTokenizer()
       .setInputCol("text")
       .setOutputCol("words")
       .setPattern("");
    
    NGram ngramTransformer = new NGram()
      .setN(3)
      .setInputCol("words")
      .setOutputCol("ngrams");
    

    With your current code (NGram(3) and sentence three words split by \W) three you'll get only one token and no similarity.

  • Increase number of hash tables (setNumHashTables) for LSH. Default value (1) is to small for anything but simple examples.

  • Normalize Unicode strings. There is a Scala Transformer in What is the best way to remove accents with apache spark dataframes in PySpark?

  • Remove capitalization. You can use SQLTransformer:

    import org.apache.spark.ml.feature.SQLTransformer
    
    val sqlTrans = new SQLTransformer().setStatement(
       "SELECT *, lower(normalized_text) FROM __THIS__")
    

相关问答

更多
  • 我找到了答案。 我需要将矩阵转换为RDD。 这是正确的代码: import org.apache.spark.{SparkConf, SparkContext} import org.apache.spark.mllib.linalg.distributed.{MatrixEntry, CoordinateMatrix, RowMatrix} import org.apache.spark.rdd._ import org.apache.spark.mllib.linalg._ def matrixTo ...
  • 标签和特征向量只包含双精度。 您的标签列包含一个字符串。 查看你的堆栈跟踪: Column label must be of type DoubleType but was actually StringType. 您可以使用StringIndexer或CountVectorizer进行适当的转换。 有关更多详细信息,请参阅http://spark.apache.org/docs/latest/ml-features.html#stringindexer 。 Labels and Feature Vect ...
  • 是的,Solr(在Lucene上运行)确实使用余弦相似性。 从Lucene文档: 文档d对于查询q的VSM得分是加权查询向量V(q)和V(d)的余弦相似度, 余弦相似性(q,d)= V(q)·V(d)/ | V(q)| | V(d)| https://lucene.apache.org/core/4_0_0/core/org/apache/lucene/search/similarities/TFIDFSimilarity.html Yes, Solr (which runs on top of Lucen ...
  • 你可以试试: import org.apache.spark.mllib.linalg.distributed._ val irm = new IndexedRowMatrix(rowMatrix.rows.zipWithIndex.map { case (v, i) => IndexedRow(i, v) }) irm.toCoordinateMatrix.transpose.toRowMatrix.columnSimilarities You can try: import org.apac ...
  • 输出向量(通过使用数据集上的变换)是提供给模型的文档(可能是句子或句子)的表示。 本质上,此输出是给定文档中每个单词的所有向量表示的组合(很可能是简单的向量和)。 您可以使用findSynonyms来获得与给定单词最相似的“num”个单词数。 findSynonyms仅基于余弦相似度。 目前我正在使用它来生成我用作另一个模型的输入的特征向量。 为了计算两个字符串之间的相似性作为某种类型的否。 你需要实现findSynonyms方法的一些变体。当前实现生成一个对应于输入字符串的cosVec,然后尝试找到最接近 ...
  • 从mllib向量转换为ml向量的最简单方法是使用Vectors.fromML方法,请参阅Vectors文档 。 例: val mlVector = org.apache.spark.ml.linalg.Vectors.dense((Array(1.0,2.0,3.0))) println(mlVector.getClass()) val mllibVector = org.apache.spark.mllib.linalg.Vectors.fromML(mlVector) println(mllibVec ...
  • DataFrame.rdd返回RDD[Row]而不是RDD[(T, U)] 。 你必须模式匹配Row或直接提取有趣的部分。 ml与Datasets使用的Vector ,因为Spark 2.0与旧API的mllib Vector使用不同。 您必须将其转换为与IndexedRowMatrix一起使用。 索引必须是Long而不是字符串。 import org.apache.spark.sql.Row val irm = new IndexedRowMatrix(inClusters.rdd.map { Ro ...
  • 我有几点建议: 如果你使用NGrams考虑更细粒度的标记化器。 这里的目标是纠正错误拼写: RegexTokenizer regexTokenizer = new RegexTokenizer() .setInputCol("text") .setOutputCol("words") .setPattern(""); NGram ngramTransformer = new NGram() .setN(3) .setInputCol("words") .setOutputCo ...
  • 这不是你的错,这是因为当前sklearn使用的sklearn和教程中使用的公式不同。 sklearn的当前版本使用此公式( 源 ): idf = log ( n_samples / df ) + 1 其中n_samples是指文档的总数(教程中的|D| ), df是指术语出现的文档数(教程中的{d:t_1 \in D} )。 为了处理零除法,它们默认使用平滑(在TfidfVectorizer选择smooth_idf=True ,请参阅文档 )来更改df和n_samples值,因此这些值至少为1: df + ...
  • Levenshtein距离是衡量标准的标准指标:计算简单,易于理解。 如果您对长文档中的字符数量持谨慎态度,则可以使用单词或句子或甚至段落而不是字符进行计算。 既然你期望类似的配对是非常相似的,那应该仍然很好。 Levenshtein distance is the standard measure for a reason: it's easy to compute and easy to grasp the meaning of. If you are wary of the number of cha ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。