当 \label{} 位于页面顶部时,\pageref{} 会产生错误的页码

当 \label{} 位于页面顶部时,\pageref{} 会产生错误的页码

我正在尝试通过命令创建一个带有页码的 para id 作为单独的文件

\def\paraopenid#1{\label{#1}\immediate\write\paraID{<ParaID="#1" StartPageNumber="\getpagerefnumber{#1}"}

当我使用或获得正确的输出时,我面临的问题是\label出现在页面顶部时,\getpagerefnumber会产生错误的页码(例如,MWE 中的最后一段) 。\clearpage\pagebreak

如何通过自动化方式获取正确的页码而无需提供\clearpage/pagebreak

平均能量损失

\documentclass{book}
\usepackage{showframe}
\usepackage{hyperref}

\newwrite\paraID
\AtBeginDocument{\immediate\openout\paraID\jobname.paraID}
\def\paraopenid#1{\label{#1}\immediate\write\paraID
 {<ParaID="#1" StartPageNumber="\getpagerefnumber{#1}"}}
\def\paracloseid#1{\label{#1}\immediate\write\paraID
 {EndPageNumber="\getpagerefnumber{#1}"/>}}

\begin{document}

\paraopenid{p1}Smart health care assistants are designed to improve the
 comfort of the patient where smart refers to the ability to imitate the
 human intelligence to facilitate his life without, or with limited, human
 intervention. As a part of this, we are proposing a new Intelligent
 Communication Assistant capable of detecting physiological needs by
 following a new efficient Inverse Reinforcement learning algorithm designed
 to be able to deal with new time-recorded states. The latter processes the
 patient's environment data, learns from the patient previous choices and
 becomes capable of suggesting the right action at the right time. In this
 paper, we took the case study of Locked-in Syndrome patients, studied their
 actual communication methods and tried to enhance the existing solutions by
 adding an intelligent layer. We showed that by using Deep Inverse
 Reinforcement Learning using Maximum Entropy, we can learn how to regress
 the reward amount of new states from the ambient environment recorded
 states. After that, we can suggest the highly rewarded need to the target
 patient. Also, we proposed a full architecture of the system by describing
 the pipeline of the information from the ambient environment to the
 different actors.\paracloseid{p1-end}

\paraopenid{p2}For LIS patients, there is only one \textit
 {Alternative Communication} method that is eye communication. Patients count
 on their caregiver to understand them. The latter relies on eye-control
 methods which are \textit{eye blinking} and \textit{eye gaze}. There are two
 critical steps in the eye-tracking process: eye detection that consists in
 localizing the eye position in the captured image, and gaze estimation
 (also called gaze detection) that consists in estimating where the user is
 looking (Tatler, Hansen, and Pelz, 2019). Gaze tracking techniques are
 integrated into Alternative and Augmentative Communication (AAC) systems.
 They permit the user to communicate with others without talking. That is why
 such systems in persons with speaking disabilities' life represent a vital
 need (Light et al., 2019). AAC research field is concerned with assisted
 communication for people that have a speech impairment. One of AAC
 research's main aims is to investigate the possibilities of improving
 communication skills for non-speakers through the use of communication There
 are several AAC systems that consider eye-tracking techniques. For instance,
 FEMA (Chareonsuk et al., 2016), which is a software designed for Amyotrophic
 Lateral Sclerosis (ALS) patients, enables them to use the computer as
 ordinary people using face and eye movements. They proved that the accuracy
 rate of left-click, right-click, double-click, scroll down, left movement
 and right movement is more than 80\%. Loja et al. proposed an AAC
 architecture that helps researchers develop an adaptive communication
 environment at a low cost (Loja et al., 2015).\paracloseid{p2-end}

\paraopenid{p3}Besides, there are some commercial tools that are designed for
 similar type of users, and some of them have a patent that gives them the
 authority conferring their license or title for a set period like Tobii
 which is a leading eye-tracking technology by gaining many
 patents.\paracloseid{p3-end}   

\paraopenid{p4}Our system's intervention commune in facilitating the patient's
 life by analyzing and trying to learn from the history of his behavior. The
 contribution consists in adding an intelligent layer to the AAC systems that
 are actually used by the target patients. It records, analyzes, and predicts
 the need depending on the history, knowing that when the patient approves
 the proposed suggestion, the system records the time and the state of the
 environment. To do so, we studied the two sides of RL. On the first side, RL
 seeks to learn the optimal behavior based on experiences, and IRL seeks to
 best understand and represent the observed behavior by learning the
 corresponding reward function. IRL introduces a new way of learning policies
 by deriving expert's intentions, in contrast to directly learning policies,
 which can be redundant and have poor generalization ability.\paracloseid
 {p4-end}

\paraopenid{p5}To choose the appropriate method for this problem, we reffered
 to (Coronato et al., 2020) who proposed a useful guideline for the
 application of RL to the healthcare problems. They provide some indications
 to the designer in order to help him in choosing the appropriate RL method.
 We concluded that we should adopt the Inverse Reinforcement Learning
 (IRL) paradigm because of the following five facts: (1) The problem involves
 a multi-step decision process. Patient's needs are expressed sequentially.
 There is no complete and accurate model of the environment. Patient's
 environment is difficult to present. (2) The actions and states can be
 presented as arrays. (3) We cannot let the agent interact with the real
 environment because we cannot propose all the possible needs at each time
 step, and let the patient answer through trial-and-error. Also, we cannot
 conclude his preference since he can change them depending on his mind or
 mood. (4) We are not able to model the reward function <italic>R</italic>
 for every possible state features. After studying the IRL variants, we
 decided to adopt the Deep Inverse Reinforcement Learning using Maximum
 Entropy since multiple reward functions can explain the patient's behavior,
 and Maximum Entropy variants are the best to represent the problem when
 there are multiple reward functions that can explain the expert's behavior
 (Arora and Doshi, 2021).\paracloseid{p5-end}

\paraopenid{p6}Maximum Entropy methods are useful when multiple reward
 functions can explain the expert's behavior (Arora and Doshi, 2021).
 Consequently, we decided to adopt it because multiple reward functions can
 explain the patient's behavior.\paracloseid{p6-end}
   
\paraopenid{p7}To enhance patient care, we suppose that the patient follows
 his healing process in a smart environment that employs ambient
 intelligence (AmI) technologies. For instance, (Kartakis et al., 2012)
 designed a smart patient room with a user interface development to assist
 both patients and medical staff in order to enhance Health Care Delivery
 through Ambient Intelligence Applications. Importantly, AmI supports the
 pervasive diffusion of intelligence in the patient environment thanks to
 wireless technologies (e.g., Zigbee, blacktooth, RF, WiFi, and intelligent
 sensors). Many other research works focused on enhancing health care
 services through AmI applications. We took the problem from the data
 scientist's perspective. What caught our attention is data delivered from
 those intelligent environments and how we can use it to ameliorate the
 patient life. Smart patient rooms can record data related to the patient
 (e.g., recording the heart beating, blood pressure, pulse oximetry, etc.)
 and related to his environment (e.g., temperature, bed, tv, window, door,
 visitor detecting, etc.).In our work, we consider six features that describe
 the patient's room in order to catch the environment's state, as mentioned
 in\paracloseid{p7-end}

\paraopenid{p8}A good deal of psychological research criticized Maslow's
 classification of needs. Some of them reported that needs doesn't really
 follow a hierarchy (Wahba and Bridwell, 1976). On the other hand, some other
 researchers were influenced by Maslow's contributions and considered them as
 a big shift in psychology. For instance, (Tay and Diener, 2011) put the
 hierarchy to test and discovered that the fulfillment of the needs was
 strongly correlated with happiness. We concluded that satisfying human needs
 is not an easy task because they differ from one person to another. On the
 first side, we have needs that depend on the studied person, his background,
 center of interest, hobbies, relationships, etc. On the other side, we have
 LIS patients who only want to accomplish the basic survival needs, and to
 balance between those two sides, we can treat the basic survival needs that
 belong to the lowest level by focusing on the \textit
 {physiological needs}\paracloseid{p8-end}

\end{document}

相关内容