/// map a sentence to a feature sequence and an action sequence
map a sentence to a feature sequence and an action sequence
map a sentence to a feature sequence and an action sequence
pub fn extract_features_and_actions<T: Tokenized>(
        &self,
        word_ids: &[u32],
        postag_ids: &[u32],
        label_ids: &[u32],
        heads: &[u32],
    ) -> (Vec<Feature>, Vec<u32>) {
        let word_pad_id = self.word_pad_id();
        let postag_pad_id = self.postag_pad_id();
        let label_pad_id = self.label_pad_id();
        let heads = projectivize(heads);
        let (state, features) = transition::GoldState::with_feature_extract::<ArcStandard, _, _>(
            &heads,
            &label_ids,
            |state| {
                Feature::extract(
                    state,
                    &word_ids,
                    &postag_ids,
                    word_pad_id,
                    postag_pad_id,
                    label_pad_id,
                )
            },
        ).unwrap();
        let actions = Vec::from(state.actions());
        (features, actions)
    }
pub fn extract_features_and_actions < T : Tokenized > ( & self , word_ids : & [ u32 ] , postag_ids : & [ u32 ] , label_ids : & [ u32 ] , heads : & [ u32 ] , ) -> ( Vec < Feature > , Vec < u32 > ) { let word_pad_id = self . word_pad_id ( ) ; let postag_pad_id = self . postag_pad_id ( ) ; let label_pad_id = self . label_pad_id ( ) ; let heads = projectivize ( heads ) ; let ( state , features ) = transition :: GoldState :: with_feature_extract :: < ArcStandard , _ , _ > ( & heads , & label_ids , | state | { Feature :: extract ( state , & word_ids , & postag_ids , word_pad_id , postag_pad_id , label_pad_id , ) } , ) . unwrap ( ) ; let actions = Vec :: from ( state . actions ( ) ) ; ( features , actions ) }
map a sentence to a feature sequence and an action sequence
map a sentence to a feature sequence and an action sequence
&self
word_ids
&[u32]
postag_ids
&[u32]
label_ids
&[u32]
heads
&[u32]