本文整理了Java中cc.mallet.types.Instance.getTargetAlphabet()
方法的一些代码示例,展示了Instance.getTargetAlphabet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getTargetAlphabet()
方法的具体详情如下:
包路径:cc.mallet.types.Instance
类名称:Instance
方法名:getTargetAlphabet
暂无
代码示例来源:origin: de.julielab/jcore-mallet-2.0.9
public Alphabet[] getAlphabets()
{
return new Alphabet[] {getDataAlphabet(), getTargetAlphabet()};
}
代码示例来源:origin: cc.mallet/mallet
public Alphabet[] getAlphabets()
{
return new Alphabet[] {getDataAlphabet(), getTargetAlphabet()};
}
代码示例来源:origin: com.github.steveash.mallet/mallet
public Alphabet[] getAlphabets()
{
return new Alphabet[] {getDataAlphabet(), getTargetAlphabet()};
}
代码示例来源:origin: cc.mallet/mallet
/** Replaces the <code>Instance</code> at position <code>index</code>
* with a new one. */
public void setInstance (int index, Instance instance)
{
assert (this.getDataAlphabet().equals(instance.getDataAlphabet()));
assert (this.getTargetAlphabet().equals(instance.getTargetAlphabet()));
this.set(index, instance);
}
代码示例来源:origin: de.julielab/jcore-mallet-2.0.9
/** Replaces the <code>Instance</code> at position <code>index</code>
* with a new one. */
public void setInstance (int index, Instance instance)
{
assert (this.getDataAlphabet().equals(instance.getDataAlphabet()));
assert (this.getTargetAlphabet().equals(instance.getTargetAlphabet()));
this.set(index, instance);
}
代码示例来源:origin: com.github.steveash.mallet/mallet
/** Replaces the <code>Instance</code> at position <code>index</code>
* with a new one. */
public void setInstance (int index, Instance instance)
{
assert (this.getDataAlphabet().equals(instance.getDataAlphabet()));
assert (this.getTargetAlphabet().equals(instance.getTargetAlphabet()));
this.set(index, instance);
}
代码示例来源:origin: de.julielab/jcore-mallet-2.0.9
/**
Iterate over segments in one instance.
@param ilist InstanceList containing sequence.
@param segmentStartTags array of tags indicating the start of a segment
@param segmentContinueTags array of tags indicating the continuation of a segment
@param predictions list of {@link Sequence}s that are the
predicted output of some {@link Transducer}
*/
public SegmentIterator (Instance instance, Object[] startTags, Object[] inTags, Sequence prediction) {
InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
ilist.add (instance);
ArrayList predictions = new ArrayList();
predictions.add (prediction);
setSubIterator (ilist, startTags, inTags, predictions);
}
代码示例来源:origin: com.github.steveash.mallet/mallet
/**
Iterate over segments in one instance.
@param ilist InstanceList containing sequence.
@param segmentStartTags array of tags indicating the start of a segment
@param segmentContinueTags array of tags indicating the continuation of a segment
@param predictions list of {@link Sequence}s that are the
predicted output of some {@link Transducer}
*/
public SegmentIterator (Instance instance, Object[] startTags, Object[] inTags, Sequence prediction) {
InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
ilist.add (instance);
ArrayList predictions = new ArrayList();
predictions.add (prediction);
setSubIterator (ilist, startTags, inTags, predictions);
}
代码示例来源:origin: cc.mallet/mallet
/**
Iterate over segments in one instance.
@param ilist InstanceList containing sequence.
@param segmentStartTags array of tags indicating the start of a segment
@param segmentContinueTags array of tags indicating the continuation of a segment
@param predictions list of {@link Sequence}s that are the
predicted output of some {@link Transducer}
*/
public SegmentIterator (Instance instance, Object[] startTags, Object[] inTags, Sequence prediction) {
InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
ilist.add (instance);
ArrayList predictions = new ArrayList();
predictions.add (prediction);
setSubIterator (ilist, startTags, inTags, predictions);
}
代码示例来源:origin: com.github.steveash.mallet/mallet
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException {
int i, size;
int version = in.readInt ();
instWeights = (HashMap<Instance,Double>) in.readObject();
pipe = (Pipe) in.readObject();
if (dataAlphabet == null) {
if (size()>0) {
Instance instance = get(0);
dataAlphabet = instance.getDataAlphabet ();
} else if (pipe.getDataAlphabet()!=null) {
dataAlphabet = pipe.getDataAlphabet ();
}
}
if (targetAlphabet == null) {
if (size()>0) {
Instance instance = get(0);
targetAlphabet = instance.getTargetAlphabet ();
} else if (pipe.getTargetAlphabet()!=null) {
targetAlphabet = pipe.getTargetAlphabet ();
}
}
}
代码示例来源:origin: cc.mallet/mallet
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException {
int i, size;
int version = in.readInt ();
instWeights = (HashMap<Instance,Double>) in.readObject();
pipe = (Pipe) in.readObject();
if (dataAlphabet == null) {
if (size()>0) {
Instance instance = get(0);
dataAlphabet = instance.getDataAlphabet ();
} else if (pipe.getDataAlphabet()!=null) {
dataAlphabet = pipe.getDataAlphabet ();
}
}
if (targetAlphabet == null) {
if (size()>0) {
Instance instance = get(0);
targetAlphabet = instance.getTargetAlphabet ();
} else if (pipe.getTargetAlphabet()!=null) {
targetAlphabet = pipe.getTargetAlphabet ();
}
}
}
代码示例来源:origin: cc.mallet/mallet
/**
*
* @param i
* @param j
* @return A new {@link InstanceList} containing the two argument {@link Instance}s.
*/
public static InstanceList makeList (Instance i, Instance j) {
InstanceList list = new InstanceList(new Noop(i.getDataAlphabet(), i.getTargetAlphabet()));
list.add(i);
list.add(j);
return list;
}
代码示例来源:origin: com.github.steveash.mallet/mallet
/**
*
* @param i
* @param j
* @return A new {@link InstanceList} containing the two argument {@link Instance}s.
*/
public static InstanceList makeList (Instance i, Instance j) {
InstanceList list = new InstanceList(new Noop(i.getDataAlphabet(), i.getTargetAlphabet()));
list.add(i);
list.add(j);
return list;
}
代码示例来源:origin: com.github.steveash.mallet/mallet
/**
Iterates over {@link Segment}s for only one {@link Instance}.
*/
public SegmentIterator (Transducer model, Instance instance, Object[] segmentStartTags,
Object[] segmentContinueTags) {
InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
ilist.add (instance);
setSubIterator (model, ilist, segmentStartTags, segmentContinueTags);
}
代码示例来源:origin: de.julielab/jcore-mallet-2.0.9
/**
Iterates over {@link Segment}s for only one {@link Instance}.
*/
public SegmentIterator (Transducer model, Instance instance, Object[] segmentStartTags,
Object[] segmentContinueTags) {
InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
ilist.add (instance);
setSubIterator (model, ilist, segmentStartTags, segmentContinueTags);
}
代码示例来源:origin: de.julielab/jcore-mallet-2.0.9
/**
*
* @param i
* @param j
* @return A new {@link InstanceList} containing the two argument {@link Instance}s.
*/
public static InstanceList makeList (Instance i, Instance j) {
InstanceList list = new InstanceList(new Noop(i.getDataAlphabet(), i.getTargetAlphabet()));
list.add(i);
list.add(j);
return list;
}
代码示例来源:origin: cc.mallet/mallet
/**
Iterates over {@link Segment}s for only one {@link Instance}.
*/
public SegmentIterator (Transducer model, Instance instance, Object[] segmentStartTags,
Object[] segmentContinueTags) {
InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
ilist.add (instance);
setSubIterator (model, ilist, segmentStartTags, segmentContinueTags);
}
代码示例来源:origin: de.julielab/jcore-mallet-2.0.9
/**
ranks the segments in one {@link Instance}
@param instance instances to be segmented
@param startTags represent the labels for the start states (e.g. B-)
of all segments
@param continueTags represent the labels for the continue state
(e.g. I-) of all segments
@return array of {@link Segment}s ordered by non-decreasing
confidence scores, as calculated by <code>estimateConfidenceFor</code>
*/
public Segment[] rankSegmentsByConfidence (Instance instance, Object[] startTags,
Object[] continueTags) {
InstanceList ilist = new InstanceList (new Noop(instance.getDataAlphabet(),instance.getTargetAlphabet()));
ilist.add (instance);
return rankSegmentsByConfidence (ilist, startTags, continueTags);
}
代码示例来源:origin: com.github.steveash.mallet/mallet
/**
ranks the segments in one {@link Instance}
@param instance instances to be segmented
@param startTags represent the labels for the start states (e.g. B-)
of all segments
@param continueTags represent the labels for the continue state
(e.g. I-) of all segments
@return array of {@link Segment}s ordered by non-decreasing
confidence scores, as calculated by <code>estimateConfidenceFor</code>
*/
public Segment[] rankSegmentsByConfidence (Instance instance, Object[] startTags,
Object[] continueTags) {
InstanceList ilist = new InstanceList (new Noop(instance.getDataAlphabet(),instance.getTargetAlphabet()));
ilist.add (instance);
return rankSegmentsByConfidence (ilist, startTags, continueTags);
}
代码示例来源:origin: cc.mallet/mallet
/**
ranks the segments in one {@link Instance}
@param instance instances to be segmented
@param startTags represent the labels for the start states (e.g. B-)
of all segments
@param continueTags represent the labels for the continue state
(e.g. I-) of all segments
@return array of {@link Segment}s ordered by non-decreasing
confidence scores, as calculated by <code>estimateConfidenceFor</code>
*/
public Segment[] rankSegmentsByConfidence (Instance instance, Object[] startTags,
Object[] continueTags) {
InstanceList ilist = new InstanceList (new Noop(instance.getDataAlphabet(),instance.getTargetAlphabet()));
ilist.add (instance);
return rankSegmentsByConfidence (ilist, startTags, continueTags);
}
内容来源于网络,如有侵权,请联系作者删除!